HI
Could you please give me an idea of how to write a .net web service to call a java web service (written by different person) via SOAP.
Thank you regards Aparna
HI
Could you please give me an idea of how to write a .net web service to call a java web service (written by different person) via SOAP.
Thank you regards Aparna
For a standard SOAP webservice call, the underlying implementation should not be important to the consuming application. Pull down the WSDL and hope that the calls are documented well enough for you to do what you need to. Be careful with type conversions from another programming language, they may not come over the webservice call exactly like you might expect in the language you use to consume the service.
You're simply going to make your .NET service be a client to your Java service:
In particular, you should have one that represents the service itself. Now, a given service may implement more than one service contract (called "port types" in WSDL terms). If the service implements the JavaServiceContract port type, then you should find a class named YourProjectNamespace.JavaService.JavaServiceContractClient. Assuming that this contract includes an operation named "JavaOperation", you should call it like this:
int returnValue = 0;
YourProjectNamespace.JavaService.JavaServiceContractClientjavaService = null;
try {
javaService =
new YourProjectNamespace.JavaService.JavaServiceContractClient();
returnValue = javaService.JavaOperation();
}
finally {
if (javaService != null) {
((IDisposable)javaService.)Dispose();
}
}
Basically calling a java web service in .net web service, .net web app or .net windows application do not have any differece as such. Have a look at this post. Hopefully it will clear all your doubts http://blogs.msdn.com/bursteg/archive/2008/07/19/how-to-call-a-java-ee-web-service-from-a-net-client.aspx
As with the answers above, it should be straightforward.
The one thing that you need to be careful about is that your exposed Java web service meets the WS-I Basic Profile standards - in other words it needs to use an rpc/literal or document/literal WSDL SOAP binding.
If you are exposing an rpc/encoded web service (which often is the case if you're using Apache Axis as your web services stack), there's a chance you could run into problems trying to consume it from a .NET client.
There's a good article here on WSDL binding styles: http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/