使用wsdl文件的Java客户端应用程序(本地)

| 我在自己的Web服务器上部署了Web服务(不在任何IIS或Tomcat上) 。因此,我所拥有的只是一个WSDL文件和一个webserver.exe(具有网络 内部实施的服务)。 使用此WSDL文件,我已经在.net中开发了一个客户端应用程序。 (C#)正常运行。 现在,我必须使用相同的WSDL在JAVA中创建另一个客户端应用程序。 但是我不知道如何进行(我是JAVA的新手)。具体来说,我有一些 有待解决的问题。.请参阅我用Java写的代码片段。
trustAllHttpsCertificates();
HttpsURLConnection.setDefaultHostnameVerifier(hv);

QName serviceName = new QName(\"Sphericall\");
URL url = new URL(\"https\",\"localhost\",8085,\"/SphericallService\");

testthebest.Sphericall_Service service = new testthebest.Sphericall_Service
(url, serviceName);
//service.create(serviceName); 

testthebest.Sphericall port = service.getSphericall();
// TODO initialize WS operation arguments here
testthebest.StartSessionRequest value = new testthebest.StartSessionRequest();
在以上代码段中,我编写了代码以绕过证书检查, 然后进行主机名验证,最后尝试创建对象 服务。 但是在创建对象时,我收到以下异常。 (未找到WSDL)。 请注意,在代码中,我为服务分配了新的URL。而在 我已经附加了Web参考(WSDL),该项目保存在我的项目中 机器的D盘。因此,它以URL为D:/xyz.wsdl而不是URL URL的正确路径,所以我将其更改为\“ https:// localhost: 8085 / SphericallService \“。但未运行..
com.sun.xml.ws.wsdl.parser.InaccessibleWSDLException: 2 counts of
InaccessibleWSDLException.

java.io.FileNotFoundException: https://localhost:8085/SphericallService
java.io.FileNotFoundException: https://localhost:8085/SphericallService?wsdl
正如我所说,我的服务位于我们自己开发的网络服务器上,并且运行起来就像 可执行文件(作为exe文件)。并单独提供了wsdl文件。所以没有路可走 wsdl像\“ https:// localhost:8085 / SphericallService?wsdl \”一样存在。 请提出您是否有任何想法。     
已邀请:
        您可以使用java函数wsimport生成客户端代码,以从wsdl文件访问Web服务。示例:http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.wsfep.multiplatform.doc/info/ae/ae/twbs_jaxwsclientfromwsdl.html     

要回复问题请先登录注册