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
Configure the Server
Configure the Client
Result
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.
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.