Using a SOAP Web Service to Make a Query to a Bookstore
Using a SOAP binding, a web service WSDL operation queries for information from a data source. The web service has one operation, GetBooksByAuthor, that is implemented in the process, QueryBooksByAuthorProvider. At run-time, a request containing an author name returns details about the author's books.
Procedure
Result
The query sends a request for "Vivek Ranadive" and returns the following book details:
17:58:24.807 [PVM:In-Memory STWorkProcessor:2] INFO c.t.b.g.L.t.b.b.s.h.BookStore.Log - Message=Book Title: The Power of Now, Author is Vivek Ranadive, Date: 1999, ISBN 0-06-566778-9, Publisher is Tibco Software Inc
Understanding the Configuration
The following processes are defined in the project:
- BookStoreServiceClient.bwp: The process implements the GetBooksByAuthor operation using BooksInterface.wsdl, and then invokes the QueryBooksByAuthorProvider process. The reply containing the query results is made by mapping to the output of the Query service. A Timer activity triggers the client and then triggers a SOAP Invoke activity, which is the actual web service client.
- QueryBooksByAuthorProvider.bwp: The process definition representing the service's business logic. The service Receive activity implements the GetBooksByAuthor operation based on the BooksInterface.wsdl file. The Read File activity reads the bookstore (an XML file in this sample). The Parse XML activity then parses the XML document. Finally, the filter is executed at the end of the process flow in the Reply (see Reply activity's Input tab).
The following resources are defined in the project:
- Resources\BookStore.xml. The file representing the bookstore database.
- HTTPConnector.httpConnResource: The HTTP shared resource to use. If you want the web service to access a different host machine or port, edit the Host and Port properties, and then regenerate the concrete WSDL from the component binding.
For more information, see TIBCO ActiveMatrix BusinessWorks™ Application Development.
The following schemas and service descriptors are defined in the project: