1.通过WSDL路径调用,这个不做说明。
2.通过ClientProxy调用:这个不需要路径中的“?wsdl”,直接连接server address
int outTime = 5000; // 毫秒
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
try {
factory.setAddress(PropritesUtils.getValue("test.url"));
} catch (IOException e1) {
e1.printStackTrace();
return null;
}
factory.getConduitSelector();
factory.setServiceClass(ITest.class);
factory.getInInterceptors().add(new LoggingInInterceptor());
ITest t = (ITest)factory.create();
Client proxy = ClientProxy.getClient(t);
HTTPConduit conduit = (HTTPConduit)proxy.getConduit();
HTTPClientPolicy policy = new HTTPClientPolicy();
policy.setConnectionTimeout(outTime * 30);//
policy.setReceiveTimeout(outTime * 30);
conduit.setClient(policy);
t.callback...(...);