users@glassfish.java.net

Re: Deployment customization

From: Vijay Ramachandran <Vijay.Ramachandran_at_Sun.COM>
Date: Tue, 15 Aug 2006 12:04:25 -0700

> First of all, sorry for cross-posting, but it's a java web service on
> glassfish question...

It is good to cross-post for faster response :)

> I'm developing a package of web services for an ERP system developed by
> my company, so I want to deploy it on serveral different servers, for my
> customers.
>
> On deployment (on development machine) it always point to
>
> <xsd:schema>
> <xsd:import namespace="webservices.everest.info"
> schemaLocation="http://company1.mshome.net:8080/Everest-war/UsuarioWSService/__container$publishing$subctx/WEB-INF/wsdl/UsuarioWSService_schema1.xsd"/>
> </xsd:schema>
>
> Glassfish will adapt the schemaLocation when deployied to another machine?

Every time you deploy a service, the WSDLs (and associated schema) get
published in the domain that you are deploying the service and hence the
addresses will be updated to the host and port configured for the
domain.

> How could I change the client at runtime to point to correct server?

One way is to do this in your client :

..
..
YourPort port = yourService.getYourPort();
((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,"http://your-new-host:your-new-port/whatever-URL-you-have-for-your-service?WSDL");
port.sayHello();
..
..

Hope this helps

Vijay

PS : Did your package-info issue get resolved ? Just checking ....