Skip to main content

javax.xml.ws.WebServiceException: Error creating dynamic stub

3 replies [Last post]
fmarceau
Offline
Joined: 2005-07-28
Points: 0

private void initialize()
{
ServiceFactory serviceFactory = ServiceFactory.newInstance();
AddressValidationService service = serviceFactory.createService(null, AddressValidationService.class);
port = service.getAddressValidation();
}

private void run()
{
Address address = new Address();
address.setMunicipalityName("toronto");
AddressArray array = port.searchAddress(address);
System.out.println(array);
}

[java] javax.xml.ws.WebServiceException: Error creating dynamic stub
[java] at com.sun.xml.ws.client.ServiceInvocationHandler.getPort(ServiceInvocationHandler.java:97)
[java] at com.sun.xml.ws.client.ServiceInvocationHandler.getXXXPort(ServiceInvocationHandler.java:64)
[java] at com.sun.xml.ws.client.ServiceInvocationHandler.invokeSIMethod(ServiceInvocationHandler.java:52)
[java] at com.sun.xml.ws.client.ServiceInvocationHandler.invoke(ServiceInvocationHandler.java:31)
[java] at $Proxy13.getAddressValidation(Unknown Source)
[java] at penson.addressvalidation.client.Application.initialize(Application.java:44)
[java] at penson.addressvalidation.client.Application.main(Application.java:15)

line no 44 : AddressArray array = port.searchAddress(address);

any idea?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kwalsh
Offline
Joined: 2003-06-10
Points: 0

As a temporary workAround to get the port do the following-

service.getPort(portQName, ServiceEndpointInterface.class)

where the first argument is the port QName and the 2nd a Class.

Currently the client code is in flux and this problem will be fixed in the next code drop-

tx,
Kathy

markpope
Offline
Joined: 2003-11-13
Points: 0

I've tried your suggestion but it fails. Am I implementing it correctly?

Old code:

ServiceFactory serviceFactory = ServiceFactory.newInstance();
SolveImplService service = (SolveImplService)serviceFactory.createService("http://localhost:8080/bidopt/solve?WSDL", SolveImplService.class);
SolveImpl port = (SolveImpl) service.getSolveImpl();

New code(last line changed only):

SolveImpl port = (SolveImpl) service.getPort(new QName("http://localhost:8080/bidopt/solve"), SolveImplService.class);

Thanks,
Mark

kohlert
Offline
Joined: 2003-06-16
Points: 0

This is a known bug that will be fixed in this weeks weekly build.