GeeCON Prague 2014*
The moose likes Web Services and the fly likes How do I correct the location address in my generated WSDL? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Web Services
Bookmark "How do I correct the location address in my generated WSDL?" Watch "How do I correct the location address in my generated WSDL?" New topic
Author

How do I correct the location address in my generated WSDL?

Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 643
I'm using Eclipse 3.5 and JBoss 5.1.0.GA to create a web service. My web service implementation class is annotated as follows:
This results in a generated WSDL that includes the following <service ...> element:
The problem is, this is my local machine address, and not the public address which I need published by the WSDL. Is there an annotation I can set that will allow me to set the host and port myself? I would like the location= to look like this:Thanks for any pointers.
Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 643
I noticed that when I deployed my application on my production server, the wsdl was encoded with the host name of the machine, rather than localhost. I'm assuming this is because I'm running the application server with the -b 0.0.0.0 argument?

Still, this is the name my machine is known by on my local network, rather than the name its known by on the internet.

So, I'm looking for a way to influence the host/port encoded in the generated WSDL.

By the way, I know I can take the wsdl, hand edit it and publish it separately to my clients. I'm assuming there is some way to get the generated wsdl to work in my production environment without having to do this.

Thanks,
Gerbrand van Dieijen
Ranch Hand

Joined: Nov 28, 2008
Posts: 30
The location-URL in the WSDL itself doesn't matter - as the real url where you connect to can be set programmatically in the client-API you use. You can try this out with SoapUI also.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Can it be the case that the JBoss AS is as "smart" as GlassFish that it modifies the address in the WSDL depending on where the request comes from?
Examples:
1. If you send a request from localhost to localhost, the address is 127.0.0.1.
2. If you send a request from another machine, the address in the WSDL will be replaced with the address from the request going into the AS.

If I were you, I would try to send a request from another computer to your local machine and request the WSDL.
Best wishes!
 
 
subject: How do I correct the location address in my generated WSDL?