启动WebServices时,遇到的问题

今天启动WebServices服务的时候,出现Failed to access the WSDL的问题,可以查看http://localhost:7630/Webservice/services/WebServiceTest?wsdl这个地址是打不开的,经过查找和研究发现,是因为wsdl生成客户端的时候,会包含wsdl中的location属性,两者不一致造成的

   <wsdlsoap:address location="http://localhost:7630/Webservice/services/WebServiceTest"/>

可知,在location属性中,生成的客户端代码中会包含其ip/电脑名,主要是生成的XXService.java文件中,其中有一个WebServices标签:

@WebServicesClient(name="AudioBroadcastingService",targetNamespace="http://jcjc",wsdlLocation="http://localhost:7630/Webservice/services/WebServiceTest?wsdl")

二者相比较可知,localhost和work-hp不对应

而@WebServicesClient其中明确定义了wsdl的位置,以及ip/电脑名信息,所以必须要保证wsdl和生成的客户端对应的ip是一致的。

所以原因就在于ip地址错误,系统访问wsdl失败,连接超时。

  1. javax.xml.ws.WebServiceException: Failed to access the WSDL at: http://localhost:7630/Webservice/services/WebServiceTest. It failed with:   
  2.     Connection timed out: connect.  
  3.     at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.tryWithMex(RuntimeWSDLParser.java:136)  
  4.     at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:122)  
  5.     at com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:226)  
  6.     at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:189)  
  7.     at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:159)  
  8.     at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:81)  
  9.     at javax.xml.ws.Service.<init>(Service.java:56)  
  10.     at com.intel.dcmtest.framework.wsdl.Dcm_Service.<init>(Dcm_Service.java:37)  
  11.     at com.intel.dcmtest.framework.Utilities.testInitOnMultiServer(Utilities.java:264)  
  12.     at com.intel.dcmtest.framework.Utilities.testInitOnCentralServer(Utilities.java:155)  
  13.     at com.intel.dcmtest.functional.api.ExternalGeneralApiTest.setUp(ExternalGeneralApiTest.java:50)  
  14.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
  15.     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)  
  16.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)  
  17.     at java.lang.reflect.Method.invoke(Method.java:597)  
  18.     at org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74)  
  19.     at org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50)  
  20.     at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33)  
  21.     at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)  
  22.     at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)  
  23.     at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)  
  24.     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)  
  25.     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)  
  26.     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)  
  27.     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)  
  28. Caused by: java.net.ConnectException: Connection timed out: connect  
  29.     at java.net.PlainSocketImpl.socketConnect(Native Method)  
  30.     at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)  
  31.     at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)  
  32.     at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)  
  33.     at java.net.Socket.connect(Socket.java:519)  
  34.     at java.net.Socket.connect(Socket.java:469)  
  35.     at sun.net.NetworkClient.doConnect(NetworkClient.java:157)  
  36.     at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)  
  37.     at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)  
  38.     at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)  
  39.     at sun.net.www.http.HttpClient.New(HttpClient.java:306)  
  40.     at sun.net.www.http.HttpClient.New(HttpClient.java:323)  
  41.     at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:788)  
  42.     at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:729)  
  43.     at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:654)  
  44.     at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:977)  
  45.     at java.net.URL.openStream(URL.java:1009)  
  46.     at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.createReader(RuntimeWSDLParser.java:785)  
  47.     at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.resolveWSDL(RuntimeWSDLParser.java:236)  
  48.     at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:107)  
  49.     ... 23 more  
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值