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.

  1. 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).
  2. Get the wsdl from the service and save it.
  3. 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.
  4. Use the C# client to call your java server – that will pass the SOAP package across.
  5. 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.
  6. Parse and respond to the messages from the C# client. This is your way of making sure you are handling the SOAP correctly.
    1. Make sure you handle exceptions as well as when it works correctly.
  7. If you get a request for the wsdl file, pass back the one the C# server generated.
  8. 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

Reply via email to