Invoking a SOAP over HTTP Web Service Using Different Binding Styles
This sample shows the creation and invocation of a SOAP over HTTP web service. It demonstrates how to use two different binding styles, RPC and DOC Literal for the same service on two different endpoints.
- Procedure
- In the samples directory, select and double-click tibco_bw_sample_binding_soap_http_mixedstylesprovider. For more information, see Accessing Samples.
- In Project Explorer, expand the tibco_bw_sample_binding_soap_http_mixedstylesprovider project.
- Set the default application profile to match the OS you are running on. For more information, see Setting the Default Application Profile.
- Fully expand the Processes directory and double-click Process.bwp.
- Click .
- At the left hand tree of Debug Configuration wizard, expand BusinessWorks Application and select BWApplication.
- Click the Applications tab and then click the Deselect All button if you have multiple applications. Select the checkbox next to tibco_bw_sample_binding_soap_http_mixedstylesprovider.
- Click
Debug.
This runs the sample in Debug mode.
- Unzip the TIBCO_HOME\bw\n.n\samples\bindings\soap\http\MixedStyles\bw5\tibco.bw.binding.soap.http.MixedStylesClient.zip file to a directory.
- Start TIBCO Designer and open the project unzipped in the directory.
- In TIBCO Designer, click Global Variables and verify the variables are set correctly.
- Click Tester and then click the green button. Select the checkbox next to the process and then click Load & Start Current.
- After the process completes, click the
Stop Testing
icon to stop the process
- In
TIBCO Business Studio™ for BusinessWorks™, click the
Terminate
icon to stop the process.
The Service has the following two different endpoint bindings:
- The Document/Literal is the endpoint for ZipPortEndpoint1.
- The RPC/Literal is the endpoint for ZipPortEndpoint2.
For the getCityInfoTest operation, you can view the information corresponding to the zip code that is defined in the zip field. Its default value is 60801. This should return information about Urbana, IL.
For the getCityDistanceTest operation, you can view the information corresponding to the distance between two zip codes. The default values are:
- 60801: Urbana, IL
- 61820: Champaign, IL
The console shows the following output:
15:24:51.971 INFO [bwThread:In-Memory STWorkProcessor-3] c.t.b.p.g.L.t.b.s.b.s.h.M.Log - Invoked cityinfo
15:24:51.992 INFO [bwThread:In-Memory STWorkProcessor-4] c.t.b.p.g.L.t.b.s.b.s.h.M.Log - getCityInfo-DOC:
city: Urbana
state: Illinois
location: Urbana, Illinois, United States
latitude: 40.11
longitude: 88.207
zip: 61801
15:24:53.857 INFO [bwThread:In-Memory STWorkProcessor-6] c.t.b.p.g.L.t.b.s.b.s.h.M.Log1 - Invoked cityDistance
15:24:53.865 INFO [bwThread:In-Memory STWorkProcessor-7] c.t.b.p.g.L.t.b.s.b.s.h.M.Log -getCityDistance-RPC: 4
Understanding the Configuration
At run-time for the first operation, the client sends a SOAP request comprising a zip code and receives a city information of that zip code. For the second operation, the client sends a SOAP request comprising two zip codes and returns the distance between the two cities defined by their zip codes.
The following shared resources are defined in the project:
- HTTPConnectorResource.httpConnResource: The HTTP Connection Shared Resource containing the transport configuration.
- CitySchema.xsd: The XSD Schema file containing the definition of the types used by the web service interface.
- ZipInfo.wsdl: The WSDL file that describes the web service.