I have C# based webservice that is hosted in a NT service. Programmatic access to the web service is of the form: soap.tcp://localhost:11141/ProcessorWebService
(The more traditional way to implement C# webservices is to put them in asp.net (.asmx) files and hosted by IIS. Access to these services is of the form: http://localhost/webservicetest/service.asmx. For various reasons, I don’t want to do that.)
I can successfully connect to my web service by from C# by:
1. Creating a C# proxy for the webservice by running WseWsdl.exe against the URL.
2. Make calls using the proxy’s.
My initial problem: How do I connect to the service from Java?
Problems I’ve encountered
1. How to create a proxy in Java?
a. I want to use wsimport against a WSDL file. But, since I don’t have a .asmx based service, I can’t just call <url>?WSDL to get it.
2. Even if I create a Java proxy (which I’ve done via some judicious hacking), I can’t seem to successfully connect to the service, when the URL is of the form soap.tcp://localhost:11141/ProcessorWebService.
a. The big difference her is using soap.tcp as the protocol, instead of HTTP. Also note that I’m going to a non traditional port. Still—I can get all of this to work from C#.
Here’s an example of my trivial program:
ProcessorWebService pws = new ProcessorWebService();
ProcessorWebServiceSoap pwss = pws.getProcessorWebServiceSoap(); ((javax.xml.ws.BindingProvider)pwss).getRequestCon text().
put(javax.xml.ws.BindingProvider.ENDPOINT_ADDRESS_ PROPERTY, "soap.tcp://localhost:11141/ProcessorWebService");
String resultFromHelloWorld = pwss.helloWorld();
It fails on the call to pwss.helloWord(); with the following:
"Unsupported endpoint address: soap.tcp://localhost:11141/ProcessorWebService"
My real questions:
Is it even possible to connect Java to a webservice hosted in a NT service?
Does anyone have any good pointers, or examples. (I’ve searched around a lot, but I’m a novice at Java, so easily could have missed something.)