Skip to main content

Dynamic Invocation fails for sample JAX-WS services

1 reply [Last post]
jaditya
Offline
Joined: 2005-07-05
Points: 0

I am using dynamic invocation to call the sample services that come bundled with jaxws-ri 2.1.3. Calling a simple service like AddNumbers fails with the following exception:

javax.xml.ws.WebServiceException: {http://duke.example.org}AddNumbersPortType is not a valid service. Valid services are: {http://duke.example.org}AddNumbersService
at com.sun.xml.ws.client.WSServiceDelegate.(WSServiceDelegate.java:229)
at com.sun.xml.ws.client.WSServiceDelegate.(WSServiceDelegate.java:174)
at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:104)
at javax.xml.ws.Service.(Service.java:56)
at javax.xml.ws.Service.create(Service.java:680)
at com.teleservices.soa.ProxyHelper.createProxy(ProxyHelper.java:140)

The service client code is:

Class serviceIfc = AddNumbersPortType.class;

WebService webService = (WebService)serviceIfc.getAnnotation(WebService.class);

QName serviceName = new QName(webService.targetNamespace(), webService.name());

Service client = Service.create(new URL(wsdlUrl), serviceName); --> Fails right here!

QName servicePort = client.getPorts().next();

// create Stub
return client.getPort( servicePort, serviceIfc );

Any ideas why?

Thanks for your attention.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jaditya
Offline
Joined: 2005-07-05
Points: 0