我有一个由wsimport生成的Web服务客户端,问题是我正在使用Binding Provider设置端点(负载均衡器Endpoint),现在当我从Binding Provider读取并打印它时,我得到的端点与WSDL上的service标签,请帮助为什么绑定提供程序设置了错误的端点。
我将端点设置为:http://xx.xx.xx:10053/services/ManageNumberCallback/SOAP11_HTTP_EP;从配置文件中读取 当我得到并打印它时,我得到:http://xx.xx.91:10053/services/ManageNumberCallback/SOAP11_HTTP_EP;在WSDL正文中注意该端点
请查看我的代码段,如果您想查看WSDL的内容,请告诉我
System.out.println("Excecuting sendESBCallback ....");
//Read the end point from the properties file
String wsdlURL = prop.getProperty("wsdlURL");
URL url = new URL(wsdlURL);
System.out.println("WSDL configured weblogic endpoint URL =>" + wsdlURL);
ManageNumberCallbackHTTPPortType_Service service = new ManageNumberCallbackHTTPPortType_Service(url,new QName("http://eai.telkom.co.za/services/ManageNumber/20121210", "ManageNumberCallback_HTTP_PortType"));
ManageNumberCallbackHTTPPortType port = service.getManageNumberCallbackSoap11HTTPEPBinding();
System.out.println("Done getting the service");
BindingProvider bp = (BindingProvider)port;
System.out.println("Done setting port");
//Setting end-point
bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, wsdlURL);
String endpoint = (String) bp.getRequestContext().get("javax.xml.ws.service.endpoint.address");
System.out.println("current endpoint =>" + endpoint);