cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: Add binding and service to given wsdl
Date Tue, 30 Nov 2010 21:21:37 GMT
On Tuesday 30 November 2010 9:34:12 am oskar.carlstedt wrote:
> Hi All,
> 
> I'm in a project goaing with strict contract first development. I our case
> we;
>    1: model a service contract
>    2: export it to xml schemas and
>    3: generate a wsdl file containing messages and port type.
> 
> We see the service and especially the binding in the wsdl file as runtime
> information that we want to be able to change during runtime, or maybe
> during deploy time (we might have to go for doing this during build time,
> but it is not the optimum way).
> 
> What I want to achieve is to bring my wsdl file (without binding and
> service declarations) to my project, and then configure a jax-ws provider
> (see below) in Spring. When a consumer is calling the service for the
> wsdl, I want cxf to create the binding and the service instance in the
> displayed wsdl file having the correct Sap version, policy declarations
> etc.
> 
> 
> Below is a provider code snippet ...
> 
> @WebServiceProvider
> @ServiceMode(value = Mode.PAYLOAD)
> public class SourceJAXWSServiceEndpointProvider implements Provider<Source>
> {
> 
> 	@Override
> 	public Source invoke(Source requestPayloadSource) {
>               // here goes my code
>         }
> }
> 
> Is this possible, and how?

Well, it's certainly not EASY.   

The easiest option would be, at build time, to use the wsdl2soap and 
wsdl2service tools we have in the bin directory to add a soap binding and a 
service.   Then reference that new WSDL at deploy.   All build time though.

To do it at runtime would be very complex.   I suppose you could write a 
utility class that would  just invoke the above two tools  at startup to 
generate a temporary WSDL.   That's probably the easiest  to  do.  The 
jaxws:endpoint sping config would depends-on that utility bean to make sure 
it's run first.



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

Mime
View raw message