Hi Joe,

You can create client from JaxWsProxyFactoryBean and set a random url, the code is as follows
       JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
       poxyFactory.setServiceClass(ServicePort.class);
       proxyFactory.setAddress("theUrlyouwant");
      ServicePort client = (ServicePort) proxyFactory.create();
Best Regards
Freeman
Joe Sunday wrote:
Sorry if this one is easy, but I can't seem to find it...

I've got an interface I generated from a local wsdl, and the wsdl files are both available on my classpath:
<definitions targetNamespace="urn:myService"
   xmlns="http://schemas.xmlsoap.org/wsdl/";
   xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
   xmlns:interface="urn:service2">
   <import location="service2.wsdl" namespace="urn:service2" />
   <service name="MyService">
      <port binding="interface:ServiceBinding" name="ServicePort">
         <soap:address location="https://localhost/sdk/myService"; />

How do I create a client for this wsdl against a random url? The binding classes seem to only accept the urn and address specified in the wsdl, which doesn't work if the url I actually want to talk to isn't localhost/sdk/myService

URL wsdlURL = MyService.class.getClassLoader.getResource("myService.wsdl");
  QName serviceName = new QName("urn:myService", "MyService");
  MyService service = new MyService(wsdlURL, serviceName);
  ServicePort client = service.getServicePort();

I don't see a generated ServiceLocator in the classes wsdl2java generated anywhere.

--Joe


Reply via email to