Is it possible to use a JSR 109 client with a locally packaged wsdl file (i.e., META-INF/Service.wsdl), yet override the soap:address that the ServiceFactory uses?
I basically want to call a web-service at a URL that I specify at runtime.
In the JbossWS user guide, it appears that I can do this using an unconfigured DII client (http://labs.jboss.com/portal/jbossws/user-guide/en/html_single/index.html#dii-clients) . But I'd like to do this with a JSR 109 client.
It appears that I can change the published wsdl location using a JSR109 client, per the following code:
ServiceFactoryImpl factory = (ServiceFactoryImpl) ServiceFactory.newInstance(); ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL wsdlLocation = cl.getResource("Service.wsdl"); URL mappingLocation = cl.getResource("jaxrpc-mapping-client.xml"); QName serviceName = new QName(SERVICE_NAMESPACE, ENDPOINT_SERVICE_NAME); ServiceImpl service = (ServiceImpl) factory.createService(wsdlLocation, serviceName, mappingLocation); ServiceMetaData data = service.getServiceMetaData(); data.setWsdlPublishLocation()
Yes, that is possible. Look at javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY