Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Interoperability

 
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Stanley Tan
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic