1 Reply Latest reply on Aug 28, 2006 10:43 AM by Thomas Diesler

    Possible to use a JSR 109 Client with a custom soap address

    sappenin Novice

      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");
       ServiceImpl service = (ServiceImpl) factory.createService(wsdlLocation, serviceName, mappingLocation);
       ServiceMetaData data = service.getServiceMetaData();

      But I don't want to change the location that the Service looks to for the WSDL. I actually want my JSR109 client use a runtime defined soap:address.

      Is this possible?