wood burning stoves 2.0*
The moose likes Web Services and the fly likes generated WSDL through wsgen and REPLACE_WITH_ACTUAL_URL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "generated WSDL through wsgen and REPLACE_WITH_ACTUAL_URL" Watch "generated WSDL through wsgen and REPLACE_WITH_ACTUAL_URL" New topic
Author

generated WSDL through wsgen and REPLACE_WITH_ACTUAL_URL

Sagar Kale
Ranch Hand

Joined: May 02, 2008
Posts: 188
Hi,

In JAX-WS, I generate wsdl using wsgen ant task. But in generated wsdl I get



Is there way so that I can set actual url either in my java source file or in ant task?


Thanks.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Have you tried to use the wsdlLocation attribute in the @WebService annotation?
If you are deploying to GlassFish, you do not have to worry about setting the address, since GlassFish will automatically do this for you.
Best wishes!
Sagar Kale
Ranch Hand

Joined: May 02, 2008
Posts: 188
I am new to webservices. But wsdlLocation is used only for contract first webservices. Correct me if I am wrong.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Yes, you are wrong.
You can write a code-first web service and then generated the WSDL. Normally when JAX-WS deploys a web service, it will generate the WSDL but if you tell it that you already have a WSDL, using the wsdlLocation in the @WebService annotation you can deploy a web service with an existing WSDL and JAX-WS will not generate a new one.
Best wishes!
Sagar Kale
Ranch Hand

Joined: May 02, 2008
Posts: 188
Thank you.
Etienne Gauthier
Greenhorn

Joined: Jan 31, 2011
Posts: 1
Hum, not that wrong the 'wsdlLocation' attribute of the @WebService annotation is marked as ' Not currently used by JAX-WS RI 2.2.1 '.

And currently, using some annotation like this one:

@WebService(name = "DepartmentService", wsdlLocation = "${testWS.wsdlLocation}")


Doesn't change the generated soap:address. It remains: 'REPLACE_WITH_ACTUAL_URL' in the generated WSDL



Etienne
Naren Chivukula
Ranch Hand

Joined: Feb 03, 2004
Posts: 576

Hi Sagar,
To answer your question, use this ANT command to find and replace your WSDL location.


Cheers,
Naren
(OCEEJBD6, SCWCD5, SCDJWS, SCJP1.4 and Oracle SQL 1Z0-051)
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Etienne Gauthier wrote:Hum, not that wrong the 'wsdlLocation' attribute of the @WebService annotation is marked as ' Not currently used by JAX-WS RI 2.2.1 '.
And currently, using some annotation like this one:
@WebService(name = "DepartmentService", wsdlLocation = "${testWS.wsdlLocation}")
Doesn't change the generated soap:address. It remains: 'REPLACE_WITH_ACTUAL_URL' in the generated WSDL
Etienne

The wsdlLocation specifies the location of an existing WSDL document for the web service, which is not the same as the endpoint address.
The wsdlLocation is usually a file on the server which the web service is deployed, but since it is an URL it is not limited to this option.
Some web service stacks, such as Metro (at least when running in GlassFish) dynamically modify the endpoint address in the WSDL depending on to which URL the request for the WSDL was placed.
Best wishes!
 
Don't get me started about those stupid light bulbs.
 
subject: generated WSDL through wsgen and REPLACE_WITH_ACTUAL_URL
 
Similar Threads
Generating WSDL through wsgen: how to automaticaly set REPLACE_WITH_ACTUAL_URL?
java.io.IOException:CreateProcess error=5, Access is denied(While running build.xml in Ant editor)
How to generate WSDL file for any JAX-WS?
Articrafts produced using wsgen tool
wscompile - how to generate wsdl from service endpoint