Per,

Technically, JAX-WS doesn't need the WSDL again at runtime if you don't 
want it.   However, it does require a bit of extra configuration.   The 
main use of grabbing the wsdl at runtime is to grab the "live" 
soap:address location.   Basically, you could publish a static wsdl at a 
known location and if the server moves, just update the soap:address in 
that static wsdl and clients would be all OK.   Also, the "live" wsdl 
may have some WS-Policy assertions or something in it that doesn't get 
recorded in the JAX-WS annotations.  

If you don't want the wsdl, that's fine.   It's a bit more work though.

Service service = new Service(serviceQName);
service.addPort(portName, 
                      SOAPBinding.SOAP11HTTP_BINDING,
                      endpointURL);
Foo foo = service.getPort(portName, Foo.class);
foo.bar(bleech);


Dan


On Monday 27 August 2007, Per Olesen wrote:
> Hi,
>
> I use the cxf-codegen-plugin maven plugin to generate java classes for
> a wsdl of mine. I then use the generated service like this:
>
>    new FooService(wdlUrl, serviceQname).getFoo().bar(bleech)
>
> But why does the FooService actually need the wsdlUrl again? I can see
> it resolves it. I thought, that when i chose the path of generating
> classes from WSDL to java, I had done all the wsdl access I needed to
> do offline.
>
> Guess this is a problem with understanding from my part. Understanding
> of why it (cxf/jaxws) needs the wsdl again!?
>
> Regards, Per



-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
[EMAIL PROTECTED]
http://www.dankulp.com/blog

Reply via email to