通过http://127.0.0.1:10082/DCCS/ws/MeterReading?wsdl访问到xml内容如下,说明接口可以访问,没有问题。
1.静态调用
// 创建一个WS客户端代理工厂Bean
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
// 判断是否抛出异常
factory.getOutInterceptors().add(new LoggingInInterceptor());
// 注册WS接口,设定WS业务类为MeterReadingUpload
factory.setServiceClass(MeterReadingUpload.class);
// 配置WS地址 http://127.0.0.1:10082/DCCS/ws/MeterReading?wsdl
factory.setAddress(url);
// 添加Aegis
factory.getServiceFactory().setDataBinding(new AegisDatabinding());
// 获取接口对象
MeterReadingUpload client = (MeterReadingUpload) factory.create();
// 超时处理
Client c=ClientProxy.getClient(client);
HTTPConduit conduit = (HTTPConduit) c.getConduit