I'm looking for advice on how to interoperate between .NET Web services and Java clients and vice-versa. If a Web method, for instance, returns a custom data type serialized in XML (assuming .NET Web service), can a Java client deserialize the object. I am assuming that both the Java client and the .NET Web service have the same class definitions for this class. Am I making any sense?
Check out this link: Calling a .NET web service from a Java client It includes the Java code needed to invoke a .NET web service from Java. The only problem I had was on parsing the response. The article has xmlReader.parse(new InputSource(new StringReader(soapMsg.getContent().toString()))); That caused an error for me and I used soapMsg.getInputStream() which worked better. I haven't gone the other way because I haven't needed to and because it is much easier to create a web service in .NET (using Visual Studio.NET) than in Java. .NET uses document/literal encoing which means that the type information is not required on the SOAP element. I have only passed strings, but other types should also work. It works well. I would suggest that you have the TcpTunnelGui monitor turned on so that you can see the SOAP request and response. This will help with debugging Let me know if you have other questions. HTH, Dave
Thanks a lot! I agree with you that its much easier to create Web services with Visual Studio .NET rather than in Java, though I haven't tried any Java IDEs yet. Can you give me more information/sample code on how to TcpTunnelGui for monitoring? Thanks!
Then you should try WebSphere Studio. It allows you to very easily (as easily as in .NET) take a piece of published WSDL and generate an entire Java stub for it, then test the stub with the built-in test tool. Likewise, you can generate a Web service from any Java bean or EJB and test it (including generation of a Java stub) with just a couple of button-clicks. Kyle