| 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
Bartender
Joined: Oct 04, 2006
Posts: 2193
|
|
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
Bartender
Joined: Oct 04, 2006
Posts: 2193
|
|
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: 542
|
|
Hi Sagar,
To answer your question, use this ANT command to find and replace your WSDL location.
|
Cheers,
Naren (SCJP, SCDJWS and SCWCD)
|
 |
Ivan Krizsan
Bartender
Joined: Oct 04, 2006
Posts: 2193
|
|
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!
|
 |
 |
|
|
subject: generated WSDL through wsgen and REPLACE_WITH_ACTUAL_URL
|
|
|