连接超时呼叫肥皂服务

时间:2019-02-14 17:20:42

标签: java web-services soap wsdl

为我提供了另一家公司的Web服务的WSDL。我使用SOUPUI进行连接并执行请求,成功了。 现在,为了在Java代码中使用它(作为Web服务的一部分),我通过右键单击WSDL并生成客户端库来生成客户端。

然后我使用此代码创建客户端

        OtherCompanyWS service = new OtherCompanyWS ();
        OtherCompanyWSPort port = service.getOtherCompanyWSPort();

        String endpointUrl = "https://url to other company ws";

        BindingProvider bp = (BindingProvider) port;
        Map<String, Object> ctx = ((BindingProvider) port).getRequestContext();
        ctx.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointUrl);

        port.callHappyOperation();

我收到以下连接超时错误

javax.xml.ws.WebServiceException: Could not send Message.
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:145)
    at com.sun.proxy.$Proxy158.retreiveHolderRequest(Unknown Source) 
Caused by: java.net.ConnectException: ConnectException invoking "https://url to other company ws" : Connection timed out: connect
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

我什至不知道从哪里开始调试此内容或我需要做什么

0 个答案:

没有答案