我正在使用SOAP服务来提供类的代理对象。从那个对象(代理类对象)我调用一个方法。该服务从我的本地运行顺利,但当我试图从部署代码的机器调用它时,我收到此错误
com.sun.xml.internal.ws.client.ClientTransportException: HTTP transport error: java.net.ConnectException: Connection timed out: connect
at com.sun.xml.internal.ws.transport.http.client.HttpClientTransport.getOutput(Unknown Source)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(Unknown Source)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(Unknown Source)
at com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Unknown Source)
at com.sun.xml.internal.ws.client.Stub.process(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown Source)
**at com.sun.proxy.$Proxy239.getHelloWorldAsString(Unknown Source)**
没有防火墙问题(防火墙已打开URL)。 这是代码
URL url = new URL("http://localhost:eservice/ws/hello?wsdl");
QName qname = new QName("http://example.com/","HelloWorldImplService");
Service service = Service.create(url, qname);
HelloWorld hello = service.getPort(HelloWorld.class);
System.out.println("helloworld obj: " + hello);
System.out.println(hello.getHelloWorldAsString("wel come to SOAP"));
第一个print语句成功执行但在第二个语句中我得到了上述异常(即at com.sun.proxy.$Proxy239.getHelloWorldAsString(Unknown Source))
)