cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: How do I write and test a sample?
Date Fri, 18 Sep 2009 15:30:31 GMT
On Fri September 18 2009 2:38:50 am Christian Schneider wrote:
> The following issues describe a way to read WSDLs from a maven repo or
> to write WSDLs to a maven repo.
> https://issues.apache.org/jira/browse/CXF-2276
> https://issues.apache.org/jira/browse/CXF-2275
> 
> So you can specifiy that the WSDL for client and server is simply read
> from the maven repo.
> 
> Btw. you can avoid using the WSDL at runtime. If you generate the code
> and configure your service like this in spring the WSDL is not necessary:
>     <jaxws:client id="customerService"
>         serviceName="customer:CustomerServiceService"
>         endpointName="customer:CustomerServiceEndpoint"
>         address="http://localhost:9090/CustomerServicePort"
>         serviceClass="com.example.customerservice.CustomerService">
>     </jaxws:client>
> 
> ServiceName and endpointName are arbitrary names. They only matter if
> someone tries to look at the generated wsdl with ?wsdl.

Just a point of note, NOT using the WSDL works fine MOST of the time, but not 
always.   There are definitely a bunch of cases where not using the wsdl 
causes problems.    The main two I know about are:

1) RPC/lit endpoints - if the targetnamespace for the operations is different 
than the service namespace, then you need the wsdl as that namespace isn't 
burned in anywhere.

2) If the wsdl has any policy requirements (like security-policy things), you 
obviously need the wsdl.

Dan



> 
> Greetings
> 
> Christian
> 
> Glen Mazza schrieb:
> > Normally, you're creating the SOAP client for somebody else's web
> > service, so, yes, you'll have the code generation within the client's
> > pom.  My SOAP-client only example does that:
> > http://www.jroller.com/gmazza/entry/creating_a_soap_client_with
> >
> > Creating a special jar for the wsdl-first example was just a simplicity
> > issue so as not to duplicate the JAX-WS code generation for both service
> > and client.  It's not perfect; namely, the *Service.java file will still
> > hardcode a specific default reference to the WSDL file on the local
> > machine, not helpful if the client and service are on different machines.
> >  To increase portability, I was thinking of somehow including the WSDL in
> > the JAR file and having the *Service.java file point to *that* WSDL if
> > possible. Still, for a simple tutorial the current method works.
> >
> > Glen
> >
> > Christian Schneider wrote:
> >> So I think my problem is solved but thanks for the nice example. I have
> >> a question about the example. You create code from the wsdl into a
> >> special jar. Wouldn´t it be easier to include the code generation into
> >> the client and the server pom?
> >>
> >> Greetings
> >>
> >> Christian
> 

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Mime
View raw message