dev@jax-ws.java.net

Best way to config _at_WebServiceClient wsdlLocation

From: AndrewHu <andrew.humphries_at_foxtel.com.au>
Date: Thu, 2 Apr 2009 21:48:32 -0700 (PDT)

Hi All -

I'm a JAX-WS newbie, at the moment wanting to set up a Web Service client.

I've generated my client side stubs using Wsimport, and used them to connect
to and invoke my webservice.

Now what I want to do is deploy my client in Glassfish as part of a web
application and use it to call the web service. Since this is happening in
multiple environments I want to be able to configure the URL used by the
Service class - defined in the wsdlLocation data member of the
@WebServiceClient annotation.

Since the value of an annotation data member can only be a constant, I can
at best define a static property on another class and refer to it in the
data member. However, since I am doing this as part of a generic WebService
framework I am creating, I didn't really want to have to have constants
defined for each WebService type I am creating - I more wanted to get
property values from a properties file and load them up depending on the
type of WebService required at run time... if you follow my meaning.

As in, I would have been happy to have something like

@WebServiceClient(name = "BlahService", targetNamespace =
"urn:BlahService/wsdl"
wsdlLocation = SEIFactory.WSDLURLMap.get("BlahService")
public class BlahService extends Service { ....

where I could lookup the URL from a Map that I would set up from properties
in a properties file, but this is not allowed with annotations. I don't
really want to have to have :

@WebServiceClient(name = "BlahService", targetNamespace =
"urn:BlahService/wsdl" wsdlLocation = SEIFactory.BLAH_SERVICE

and define a constant for every webservice (of course I could set the value
of that constant from my props file etc.)

Or am I going completely the wrong way about this ? Is there a simpler way
to do this - ie via an XML file? I've been googling on this and not really
found much. Can I configure the Since we are using Spring I am looking into
how to configure the client via Spring XML.

any help or appreciated :-)

Thanks,

Andrew





-- 
View this message in context: http://www.nabble.com/Best-way-to-config-%40WebServiceClient-wsdlLocation-tp22861788p22861788.html
Sent from the JAX-WS Development mailing list archive at Nabble.com.