Calling java web service with .net web service
For a standard SOAP web service call, the underlying implementation should not be critical to the consuming application. Pull out the WSDL and hope the calls are well documented enough that you can do what you need to do. Be careful with conversions from another programming language, they may not come through a webservice call exactly as you might expect in the language you are using to use the service.
a source to share
As with the answers above, it should be simple.
The only thing you need to be careful about is that your Java open web service conforms to 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 browsing the rpc / encoded web service (which is often the case if you are using Apache Axis as your web service stack), chances are you might run into problems trying to use them from a .NET client.
There is a good article on WSDL binding styles here: http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/
a source to share
You just make your .NET service a client of your Java service:
- Right click on the web service project and use "Add Service Reference"
- Enter the WSDL URL of the Java Web Service in the Address field, then click Go
- Specify "Namaespace" through which the Java service will be accessed, for example "JavaService". Click OK.
- If all goes well, you should now have several classes created for you in the "YourProjectNamespace.JavaService" namespace.
In particular, you must have one that is a service. Now a given service can implement more than one service contract (so called port types) in WSDL terms). If the service implements the JavaServiceContract port type, you should find a class named YourProjectNamespace.JavaService.JavaServiceContractClient. Assuming this contract includes an operation called "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();
}
}
a source to share
Basically calling a java web service in a .net web service ..................................... .............. Take a look at this post. Hope this clears 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