wood burning stoves 2.0*
The moose likes Web Services and the fly likes Jax-ws 2.2.1: creating clients for endpoints that are not in the WSDL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Jax-ws 2.2.1: creating clients for endpoints that are not in the WSDL" Watch "Jax-ws 2.2.1: creating clients for endpoints that are not in the WSDL" New topic
Author

Jax-ws 2.2.1: creating clients for endpoints that are not in the WSDL

Joep Availableonrequest
Greenhorn

Joined: Mar 18, 2011
Posts: 2
Hello,

I have a setup in which a 'scheduler' sends requests to different webservices. The interfaces for those webservices are the same, although they perform slightly different tasks. I wrote a general wsdl file which I would like to use for all those services. So I use a wsimport to generate a client. All is good so far. I should be able to do something like:



Unfortunately, I cannot find how to just change the url of a webservice. I can give parameters to MyService in the form of a 'wsdl location', a Qname and WebServiceFeatures, but not a different url. If I try to skip the generated MyService class and look in Service.create(), I still can't find the place where to add the new address of the endpoint. I can add 'endpoints' but then I can only make 'Dispatch' objects which seems to operate at a lower lever than I would like. I also couldn't find clues in the source code.

Did I miss something obviouss or is it really not done to use the same WSDL to generate clients for different web-services with the same contract?

Thanks in advance

Joppeknol

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
You set the BindingProvider.ENDPOINT_ADDRESS_PROPERTY property in the request context prior to sending a request.
The following example shows how to set the property when working with an object implementing the Dispatch interface:

Here is an example how to set this property when working with generated stubs:

Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
Joep Availableonrequest
Greenhorn

Joined: Mar 18, 2011
Posts: 2
Ivan Krizsan wrote:


Exactly what I needed. It works. Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jax-ws 2.2.1: creating clients for endpoints that are not in the WSDL