dev@glassfish.java.net

Re: Changing the <soap:address location=...> in WSDL file

From: Vijay Ramachandran <Vijay.Ramachandran_at_Sun.COM>
Date: Thu, 08 Mar 2007 06:40:36 -0800

There is no way to change the host and port through wsgen.

Note that the host and port with which the WSDL is published is those
values present in the incoming WSDL request.

So if the client requested the WSDL with URL
http://pcpcwl:8080/CalculatorWS/CaclculatorWSService?WSDL, then the WSDL
is published with pcpcwl as host and 8080 as port.

If the client requested the WSDL with URL
http://localhost:8080/CalculatorWS/CaclculatorWSService?WSDL, then the
WSDL is published with localhost as host and 8080 as port.

Vijay

Chris Loftus wrote:
> Hello,
>
> Is there a way to get wsgen to change the WSDL <soap:address
> location=uri..> ? When deploying locally the name of my PC is used: e.g.
>
> http://pcpcwl:8080/CalculatorWS/CaclculatorWSService
>
> The problem is that this name is also included in the WSDL element:
>
> <xsd:schema>
> <xsd:import namespace="http://ws/"
> schemaLocation="http://pcpcwl:8080/CalculatorWS/CaclculatorWSService/__container$publishing$subctx/WEB-INF/wsdl/CaclculatorWSService_schema1.xsd"/>
>
> </xsd:schema>
>
> When a web service client imports this it fails since it doesn't know
> the host pcpcwl.
>
> How can I configure the hostname to use in the WSDL file? There didn't
> seem to even be a way of manually editing this file on the server
> side, either via the admin console, or netbeans or the wsgen command
> in the build.xml file.
>
> One workround suggested is to obtain the WSDL file and then edit it
> manually on the server side to change the URI values and then use the
> @WebService and its WSDL attribute. However, if there's some way to
> specify the host when automatically generating WSDL from the wsgen
> command then that would be better.
>
> Many thanks,
>
> Chris
>