Question

I have a .Net Webservice and I used JAX-WS to generate the stubs for it (downloaded the WSDL and XSD locally). Now I packaged the stubs in one jar (stubs.jar) and the WSDL as well as XSD in other jar (wsdl.jar).

I use the stubs like:

URL url = ServiceClient.class.getResource("MyService.wsdl"); 
MyService service = new MyService(url,new QName(namespaceURI,localName));
MyServicePortType portType = service.getMyServicePort();
BindingProvider bp = (BindingProvider) portType;
//WSDL_URL is the actual endpoint address
bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, WSDL_URL);

Although everything works fine, but during debugging I noticed that the port type object creation takes a lot of time.

Also, the port type object on debugging shows the WSDL URL as the remote URL (even before it is type casted into Binding Provider object).

I am not able to identify the reason for the changed URL of WSDL in Port type object. Anyone, please help me understand.

Also, is there anything that can be done to reduce the time taken to create the port type objects.

Thanks in advance!

No correct solution

OTHER TIPS

The first time MyService gets the URL from the WSDL document file (a local file). Because loads the file, it takes longer. This should be done only at the beginning of the application.

MyService service = new MyService(url, new QName(namespaceURI, localName));

Then, your customize the endpoint URL.

bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, WSDL_URL);

If the URL is the same, maybe you can avoid this step. This is very useful when the URL is different, like when you change from the development environment to the production environment.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top