dev@glassfish.java.net

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

From: Chris Loftus <cwl_at_aber.ac.uk>
Date: Thu, 08 Mar 2007 16:52:55 +0000

Hi Vijay,

> 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.

This was not my experience when sending a request from a browser client.
E.g. I have just started the SJSAS 9.0_01 (b14) app server on a Solaris
10 computer called dante. This is running a web service where the WSDL
was generated automatically using wsgen (actually via netbeans deployment).

When I use the following URL in a browser on a PC client:

http://193.60.15.204:8089/CalculatorWS/CalculatorWSService?WSDL

I received the following:

<definitions targetNamespace="http://ws/" name="CalculatorWSService">
    <types>
    <xsd:schema>
       <xsd:import namespace="http://ws/"
 schemaLocation="http://dante:8089/CalculatorWS/CalculatorWSService/__container$publishing$subctx/WEB-INF/wsdl/CalculatorWSService_schema1.xsd"/>
   </xsd:schema>
  </types>
   ....
   <service name="CalculatorWSService">
-
    <port name="CalculatorWSPort" binding="tns:CalculatorWSPortBinding">
       <soap:address
location="http://dante:8089/CalculatorWS/CalculatorWSService"/>
    </port>
   </service>
</definitions>

So as you can see it uses the servers name in the WSDL rather than the
IP address that I used in the URL. And my PC cannot access the domain
name dante using that name.

Do you think it could be a bug in that particular version of the app
server?

Thanks

Chris

> 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
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>


-- 
Chris Loftus mbcs
University of Wales, Aberystwyth
Dept of Computer Science
Penglais, Aberystwyth
Ceredigion, SY23 3DB
Wales, UK
Tel: +44 (0)1970 622422