Sending a SOAP Request and Receiving a SOAP Reply

A SOAP client is configured to send messages to a SOAP server, which processes the requests and sends the responses back to the SOAP client.

Prerequisites

Note: To run the sample you can either use TIBCO ActiveMatrix BusinessWorks 6.x client or TIBCO ActiveMatrix BusinessWorks 5.x as a client.

Procedure

Configure the Server

  1. In the samples directory, select binding > soap > http > WSDLImportWSDLand double-click tibco.bw.sample.binding.soap.http.WSDLImportWSDL. For more information, see Accessing Samples.
  2. In Project Explorer expand the tibco.bw.sample.binding.soap.http.WSDLImportWSDL project.
  3. Set the default ApplicationProfile to match the OS you are running on. For more information, see Setting the Default Application Profile.
  4. Fully expand the Processes directory and double-click QueryBooksByAuthor.bwp.
  5. Click Run > Debug Configurations.
  6. At the left hand tree of Debug Configuration wizard, expand BusinessWorks Application and select BWApplication.
  7. Click the Applications tab and then click the Deselect All button if you have multiple applications. Select the check box next to tibco.bw.sample.binding.soap.http.WSDLImportWSDL.application.
  8. Click Debug.
    This runs the sample in Debug mode.

Configure the ActiveMatrix BusinessWorks 5.x Client

  1. In TIBCO Designer, import the client project, bw5\tibco.bw.sample.binding.soap.http.WSDLImportWSDL.client.
  2. Update the HTTP shared resource configuration and verify the Host and Port values and OUTPUT_FILE global variable.
    If you updated HTTPConnector.httpConnResource in the project, you must regenerate the concrete WSDL and import it into the 5.x client project.
  3. In TIBCO Designer, click Tools > Tester > Start.
  4. In TIBCO Business Studio™ for BusinessWorks™, click the Terminate icon to stop the process.

Result

The output of the SOAP Request Reply activity shows the book values returned by the server, Advanced Java John Doe March, 2002 0596002111 O'Connelly.

Understanding the Configuration

This sample shows how to generate a concrete WSDL, when an abstract WSDL imports another WSDL, and how it is exposed by a service using a SOAP over HTTP binding. The server side is implemented in ActiveMatrix BusinessWorks 6.x and the client side is implemented in ActiveMatrix BusinessWorks 5.x. The client side shows a SOAP palette resource named SOAP Request Reply, which is used to send a SOAP request to the server and receive a SOAP response.

The abstract WSDL is named BooksInterface.wsdl:
  • The BooksInterface.wsdl abstract file imports the BooksMessage.wsdl file, which contains messages used by the operations in BooksInterface.wsdl.
  • The BooksMessage.wsdl file imports the Books.xsd schema file, which contains elements used by the messages in the BooksMessage.wsdl file.
  • The Books.xsd schema file includes the BooksType.xsd schema file, which contains the types used by the elements in the Books.xsd file.
  • The SOAP over HTTP binding is used in the process service.

tibco.bw.sample.binding.soap.http.WSDLImportWSDL in ActiveMatrix BusinessWorks 6.x contains the QueryBooksByAuthor process, which shows how to receive a SOAP request from the SOAP client and process the request. This process executes as follows:

  1. The service exposed via SOAP over HTTP receives a SOAP request.
  2. The Reply activity from the Basic Activities palette sends a response back to the client.

tibco.bw.sample.binding.soap.http.WSDLImportWSDL.client in ActiveMatrix BusinessWorks 5.x contains the QueryBooksByAuthor process, which shows how to send a SOAP request to the SOAP server and process the response. This process definition executes as follows:

  1. The Timer activity starts a job.
  2. The SOAP Request Reply activity sends a SOAP request to the SOAP server and receives the response from the server and writes the response to OUTPUT_FILE location.