Steven,

Technically, with JAX-WS, you don't need the wsdl.   However, the spec 
does say that if it's available/specified, we're supposed to use it.  
For the most part, if you remove the wsdlLocation attribute, it should 
work.

The client side ends up being a bit different.   You don't really use the 
generated service class.   Instead, you can do something like:

PortClass port = Service.create(serviceName).getPort(PortClass.class);
((BindingProvider)port).getRequestContext().put(
    BindingProvider.ENDPOINT_ADDRESS_PROPERY,
    "http://foo.com/blah";);


You MAY be able to pass null into the generated service for the 
wsdlLocation.   I'm not sure if that works or not.   You would still 
need to set the endpoint address though.   That doesn't get recorded 
anywhere.

Dan


On Wednesday 02 May 2007 16:33, Steven E. Harris wrote:
> I'm trying to understand a big difference in how a Web Service client
> works in JAX-WS/CXF versus AXIS2. In AXIS2, the WSDL2Java process
> reads a WSDL document and creates a lot of code to create, transport,
> and consume messages as directed by the WSDL. After this WSDL2Java
> process, the WSDL document is no longer required; it has essentially
> been compiled into a set of Java operations that obey the WSDL's
> specifications.
>
> In JAX-WS, the WSDL2Java process also creates code, annotated with
> details from the motivating WSDL document. I had assumed that these
> annotations are used at compile time to generate much of the extra
> code we see generated by the AXIS2 WSDL2Java process. Instead, I find
> that the generated Service type wants to read a WSDL file in its
> constructor (following the call chain along to
> org.apache.cxf.wsdl11.WSDLServiceFactory.create() called on by
> org.apache.cxf.jaxwsServiceImpl.initializePorts()).
>
> Why does the client need to read the WSDL file at run time? Don't the
> annotations and method signatures provide enough information to lock
> in the basic operations it must perform? Is there some way to avoid
> needing to use the WSDL file at run time?

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