Hi all;
Well after over 2 weeks of trying to create a web service
using Axis and the JWSDK, and giving up, I found an easy way to do it that is
also totally portable.
- Create a web service using
Visual Studio/C# where the server has your complete API, but doesn’t
do anything (ie basically just an interface).
- Get the wsdl from the service
and save it.
- Write either a servlet or a NIO
http server (I did the second). At first have it just print out the text
stream it receives.
- Use the C# client to call your
java server – that will pass the SOAP package across.
- Viewing the text stream, figure
out how to pull out the SOAP. The SOAP is just xml so you can then parse
it using jdom or dom4j.
- Parse and respond to the
messages from the C# client. This is your way of making sure you are
handling the SOAP correctly.
- Make sure you handle
exceptions as well as when it works correctly.
- If you get a request for the
wsdl file, pass back the one the C# server generated.
- Once the server is working,
create a java client and test it against first the C# dummy server and
then the real java server.
In my case the whole thing took under 3 days. Everything
works fine, no coming up against bugs or incomplete documentation. And best of
all, it’s totally portable and does not require anything to be installed
to work. (If you go the servler route, then you do need an app server –
but it’s any app server.)
- dave
|