HTTP and SOAP Channels : Configuring BusinessEvents as a SOAP Server and Client

Configuring BusinessEvents as a SOAP Server and Client
Using an HTTP channel and a destination configured to use a SOAP Serializer, BusinessEvents can act as a web services platform, sending and receiving SOAP requests. You can configure the project manually or using a WSDL import utility, which greatly simplifies configuration.
This release supports SOAP version 1.1. Some understanding of SOAP protocol is required in order to work with this feature. See http://www.w3.org/TR/soap/ for details.
Overview of SOAP Related Resources
The following project resources must be configured so that BusinessEvents can send and receive SOAP messages.
SOAP Destinations
When a correctly configured HTTP destination receives a SOAP request, the SOAP serializer deserializes the SOAP message to its corresponding event. That event has to be inherited from a SOAPEvent. The event payload contains the SOAP envelope.
SOAP Events
To create a SOAP event, create a SimpleEvent that inherits a SOAPEvent. It makes event configuration easier. Its payload has a message root element having an Envelope child element. The root element contains Header and Body elements, and the Body element has a Fault element. You can further configure these elements using the payload editor.
SOAP messages (and events) can have attachments.
SOAP Encoding
Only the SOAP document/literal form of encoding is supported.
Rules and Rule Functions
A rule in the project accesses the SOAP event payload as needed using the mapper or SOAP catalog functions. The rule puts the SOAP response into the payload of a SOAPEvent that is sent to the client. The SOAP serializer sends the SOAP response to the client.
SOAP Catalog Functions
SOAP catalog functions enable you to access and process the contents of the following elements in the event payload of an incoming SOAPEvent, and add elements to the outbound SOAPEvent:
See Parsing and Building SOAP Messages for more details.
Mapping of SOAP Request URI to Destination
For Soap requests, the header property SOAPAction represents the destination name, and the requestURI represents the channel URI. BusinessEvents combines these SOAPAction and requestURI to create destination URI. It maps the request with a destination having same URI as the newly created URI.
For example, if the requestURI of a request is /QueryBooks and the value of SOAPAcion is QueryBooksByAuthor, then BusinessEvents engine maps the request with a destination having /QueryBooks/QueryBooksByAuthor URI if it exists.
Manual Configuration
You can either manually create and configure project resources to work with SOAP services or use the WSDL import feature which creates the resources for you, and then configure them as needed. See Understanding the WSDL to Project Resource Mapping for details.
This section outlines manual configuration steps.
 
Task A Configure the HTTP Channel and SOAP Destination
Configure an HTTP channel, an HTTP connection resource for the channel. See Working with HTTP Requests for details. Connection configuration is the same for SOAP and HTTP channels, except that for SOAP destinations, you need to use
com.tibco.cep.driver.http.serializer.SOAPMessageSerializer
Task B Add a SOAPEvent (and Other Ontology as Needed)
Configure SOAPevents that will be used to receive the SOAP requests and send out SOAP responses. SOAPEvent is an event type provided with BusinessEvents. also configure any other ontology
1.
2.
The Payload is automatically configured with the structure of a SOAP message, with Header and Body elements, and within the Body element, a Fault element. You can further configure the Header and Body elements using the payload editor.
Task C Configure Rules and Rule Functions using SOAP Functions
In general the procedure of serving requests and sending requests to other servers is the same for SOAP services as for other HTTP interactions. See Working with HTTP Requests.
Configure rules and rule functions to access information from the SOAP messages in the inbound events, and to populate outbound events with SOAP message details. See Parsing and Building SOAP Messages.
Using the WSDL Import Utility
WSDL (Web Services Description Language) is an XML format for describing web services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information.
BusinessEvents can import a WSDL file and create the required project artifacts based on it, such as events, rules, rule functions, channels, and destinations.
You can then implement the rules and rule functions to provide the expected behavior for the web service described in the WSDL file.
When you import an abstract WSDL, channel and transport information is not available and you must create those resources manually. Concrete WSDLS contain information that is used to create these resources automatically.
Only document style WSDLs with literal encoding are supported in this release.
See Understanding the WSDL to Project Resource Mapping to understand what project resources are created, and which sections of the WSDL are used to create each resource.
To Import a WSDL File
1.
2.
In the Import dialog, select WSDL, and click Next.
3.
4.
Click Finish.
5.
Using the WSDL Export Utility
The WSDL export utility allows you to export rules and rule functions that have a SOAPEvent as a parameter, as a WSDL file.
Table 18 shows how the project resources are exported as a WSDL file.
SimpleInEvent inheriting from a SOAPEvent.
SimpleOutEvent inheriting from a SOAPEvent.
The base structure (Envelope -> Header -> Body) which conforms to SOAP schema, is created. You can define your own schemas for header elements and body and use them with this.
Forms the <soap:address> host and port.
Select HTTP as the Driver, Resource as the Method of Configuration and point to the HTTP Connection.
Forms the <soap:address> URI.
Set SOAPMessageSerializer as the default serializer.
Forms the soapAction attribute of the operation.
Ensure that the rule function has SOAPEventIn as the input parameter, and SOAPEventOut as the return type.
Forms the <wsdl:operation> operation.
In the Destination Group of Agent Classes, associate each destination with a preprocessor rule function. Thus the destination name becomes soapAction specified for that particular operation.
Associates soapAction to the operation in the HTTP binding.
To Export a Rule or Rule Function as a WSDL
1.
2.
In the Export dialog, select WSDL under TIBCO BusinessEvents, and click Next.
3.
4.
5.
Click Finish.
6.