报错: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();