Quantcast
Channel: sharepoint – Java && Linux
Viewing all articles
Browse latest Browse all 8

cxf NTLM 客户端验证(Spring 配置)

$
0
0
FormServiceSoap cs = (FormServiceSoap) ctx.getBean("client");
Client client = ClientProxy.getClient("http://10.188.12.7/formservice.asmx?wsdl");
HTTPConduit http = (HTTPConduit) client.getConduit();
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
httpClientPolicy.setConnectionTimeout(36000);
httpClientPolicy.setAllowChunking(false);
http.setClient(httpClientPolicy);
http.getAuthorization().setAuthorizationType("NTLM");
http.getAuthorization().setUserName("xxxx");
http.getAuthorization().setPassword("xxxxx");
URL wsdlURL = FormService.WSDL_LOCATION;
#boolean port = cs.createSystemError("123", "456", "789", "0123", true); 这个是我用cxf自动生成的一个web service方法
System.out.println(port);

主要spring 配置文件

<bean id="client" class="org.tempuri.FormServiceSoap"
        factory-bean="clientFactory" factory-method="create" />

    <bean id="clientFactory"
        class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
        <property name="serviceClass" value="org.tempuri.FormServiceSoap" />
        <property name="address" value="http://sharepoint/formservice.asmx?wsdl" />
    </bean>

Viewing all articles
Browse latest Browse all 8

Trending Articles