解决调用WebService
报错:Caused by: java.io.IOException: java.net.URISyntaxException:
Invalid address. Endpoint address cannot be null. at index 0: <null>
解决方法:
将原来代码换成:
QName SERVICE_NAME = new QName("http://service.request.operation.draft.pcitc.com/", "接口服务名");
QName PORT_NAME = new QName("http://localhost:8080/bmbank/webservice/", "接口服务名+Port");
Service service = Service.create(SERVICE_NAME);
String endpointAddress = "http://localhost:8080/bmbank/webservice/ReqRegisterService";
service.addPort(PORT_NAME, SOAPBinding.SOAP12HTTP_BINDING, endpointAddress);
ReqRegisterService req=service.getPort(ReqRegisterService.class);
换成如下代码:
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setServiceClass(ReqRegisterService.class);
factory.setAddress("http://localhost:8080/bmbank/webservice/ReqRegisterService");
ReqRegisterService req = (ReqRegisterService) factory.create();
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。