Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 通过代理连接到web服务_Java_Web Services_Soap_Wsdl_Wsimport - Fatal编程技术网

Java 通过代理连接到web服务

Java 通过代理连接到web服务,java,web-services,soap,wsdl,wsimport,Java,Web Services,Soap,Wsdl,Wsimport,我已经使用wsimport从wsdl文件创建了java代码 我想使用代理连接到web服务,我得到以下代码(生成): 我可以选择配置将WebServiceFeature传递给getSiriWSPort构造函数的代理,如注释中所述: /** * * @param features * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported f

我已经使用wsimport从wsdl文件创建了java代码

我想使用代理连接到web服务,我得到以下代码(生成):

我可以选择配置将WebServiceFeature传递给getSiriWSPort构造函数的代理,如注释中所述:

 /**
     * 
     * @param features
     *     A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy.  Supported features not in the <code>features</code> parameter will have their default values.
     * @return
     *     returns SOAPPort
     */
    @WebEndpoint(name = "SiriWSPort")
    public SOAPPort getSiriWSPort(WebServiceFeature... features) {
        return super.getPort(new QName("http://someip/Siri/SiriServices/", "SiriWSPort"), SOAPPort.class, features);
    }
我找到了一些关于配置的信息,但找不到包含ClientProxyFeature的jar

谢谢

你应该看看

我使用的是基于CXF的客户端,带有http代理和证书身份验证,效果非常好。我手头没有IDE,但在您的情况下,我想它可能看起来像这样:

SiriServices siri = new SiriServices();
SOAPPort port = siri.getSiriWSPort();
org.apache.cxf.endpoint.Client client = ClientProxy.getClient(port);
HTTPConduit conduit = (HTTPConduit) client.getConduit();
conduit.getClient().setProxyServer("...");
conduit.getClient().setProxyServerPort(...);
SiriServices siri = new SiriServices();
SOAPPort port = siri.getSiriWSPort();
org.apache.cxf.endpoint.Client client = ClientProxy.getClient(port);
HTTPConduit conduit = (HTTPConduit) client.getConduit();
conduit.getClient().setProxyServer("...");
conduit.getClient().setProxyServerPort(...);