On Wed May 27 2009 5:57:36 am Valerio Schiavoni wrote:
> Hello,
> suppose you use a wsdl to generate the required classes to build your
> application.
> Assume you only know the java interface generated, its type.
>
> For instance, for the meteo webservice
> http://www.webservicex.net/globalweather.asmx?WSDL, this interface is:
> net.webservicex.GlobalWeatherSoap
>
> Given that: how do you discover which class is capable of instantiating
> objects of that type?

Well, that's kind of a "unusual" question.    I guess the technical answer 
would be that you would need to scan the generated class looking for anything 
that extends javax.xml.ws.Service and check the methods on them.

That said, use of the generated Service objects is really optional.  They are 
only a convenience.   You can just create an instance of  javax.xml.ws.Service 
and use it directly to create the GlobalWeatherSoap port object.     Take a 
look at the generated code for the generated Service objects and you see it 
just forwards all the stuff into the "generic" methods on the Service 
superclass.    You can do all that in code.

Dan



> By 'discover' I mean automatically,
> by some introspection on the java class, by looking in the classpath..where
> can I find hints on the java signature of such factory class, without
> re-reading the original wsdl + jaxb files eventually used?
>
> Thanks for suggestions
> valerio

-- 
Daniel Kulp
[email protected]
http://www.dankulp.com/blog

Reply via email to