I\'m in a difficult position: We have a 3rd party enterprise system that exposes a Java-based API. However, we are a 100% .Net oriented development team.
I ended up finding a solution that was far easier than any of the above. We created some simple classes (like the doPing() method in @Thorbjørn Ravn Andersen's answer) with the @javax.jws.WebService
and @javax.jws.WebMethod
annotations, then deployed them using:
string url = "http://localhost:8282/MyService"
MyService serviceInstance = new MyService();
Endpoint svc = Endpoint.publish(url, serviceInstance);
I was then able to point Visual Studio at http://localhost:8282/MyService?wsdl
and generate a client. Easy as pie.
We have run a lot of requests through this service over a large span of time and have not noticed any problems. We wrapped this with the Java Service Wrapper so that it comes back up across reboots/JVM crashes, etc. A poor man's application server.
I hope this might help any other .NET developer looking to interoperate with Java without having to remap your brain to do it.