Web Services Clients



Manually calling Web services via simple HTTP post requests



The following demos show how to call a web service in a non OO way using a simple http post request.
The source is in java, but any language that can post an http request can do this and the source
can still be a reasonable guide.
Keep in mind that this is not the way you would normally call a service, but this is a way to do it without
using a SOAP/web service toolkit of some sort either if you choose not to or if you cannot because
your languange and/or version does not have the ability. Such as Delphi below version 5.
Also that the response is in XML and may have to be parsed to obtain the information you are looking for.
The source code is fairly lengthy, but that is only because it is a fully functional jsp and contains some
documentation and all errors produce messages on the web page.

Manually getting a string property via a simple HTTP post method.

Manually setting a string property via a simple HTTP post method.

Manually getting an integer property via a simple HTTP post method.

Manually setting an integer property via a simple HTTP post method.

Manually getting a complex object property via a simple HTTP post method.

Manually setting a complex object property via a simple HTTP post method.

Calling Web services via SOAP



The following demos show how to call a web service using the Soap SDK/toolkit/generated classes.
The source is in java, but can still be a reasonable guide for other languages.
This is the way you would normally call a service and is far easier than the above demos.
The response is automatically parsed for you and you just deal with the details.
The source code is again fairly lengthy, but that is only because it is a fully functional jsp and contains some
documentation and all errors produce messages on the web page.


Various languages do this differently.
For instance Visual Basic 6 allows you to easily access the web services without creating extra objects and whatnot.
For Java however, it is easiest to use the stub classes.
This is because they are so easy to generate.
In some cases they are created by the IDE that created the server side service.
In other cases you can just get a utility that will generate them.
For instance, Axis allows you to run their WSDL2Java utility to create everything you need to use the service.
I will be using those.
You can see a list of all the available services and get their wsdl files on the web site serving the services.
In this case you would go to http://www.hitekdev.com/TomcatWebServiceDemoWebModule/index.html
clicking on a service will give you a list of the methods available and a link to the wsdl.

Weblogic 8.1 even presents an Ant task to generate the stubs!


Getting a string property via SOAP.

Setting a string property via SOAP.

Getting an integer property via SOAP.

Setting an integer property via SOAP.

Getting a complex object property via SOAP.

Setting a complex object property via SOAP.



Last updated Wednesday, September 8th, 2005