cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: WebServiceProvider + schema validation
Date Fri, 12 Sep 2008 16:50:46 GMT
On Thursday 11 September 2008 8:23:17 pm Lee Breisacher wrote:
> > then the publish fails because it ends up in buildServiceFromWSDL().
>
> I misunderstood this error. Now I've fixed that, but still no validation is
> taking place.
>
> So, this is really quite a simple question:  How can I turn on server-side
> schema validation when the implementation is a WebServiceProvider?

Hmmmm.....  I'm not sure there is a way right now.   Currently, the 
schema-validation-enabled thing is passed into the databinding so the 
databinding can setup the necessary stuff to do the validation.   With the 
provider stuff, there isn't a databinding so it's not doing anything.   

Definitely log a bug.   If you want to dig into it, most likely, the 
DispatchInDatabindingInterceptor would need to be updated to validate the XML 
stuff after parsing it.   The setSchemaInMessage method in the superclass can 
be used as an example of how to get the Schema object.   From there, for the 
SOAPMessage case, use it directly after parsing.   For the XMLMessage case, 
probably set it into the XMLStreamDataReader and update the 
XMLStreamDataReader to domparse + validate if schema-validate is enabled.

Dan




>
> Thanks,
>
> Lee
>
> > -----Original Message-----
> > From: Lee Breisacher [mailto:LBreisacher@seagullsoftware.com]
> > Sent: Thursday, September 11, 2008 1:29 AM
> > To: users@cxf.apache.org
> > Subject: WebServiceProvider + schema validation
> >
> > I have a wsdl with various operations. I'm implementing using
> > a single WebServiceProvider class. That's all working fine.
> > However, I want to enable schema validation, so incoming
> > requests are validated against the wsdl. If I try the
> > obvious, like this:
> >
> >         EndpointImpl ep = (EndpointImpl)Endpoint.create(new
> > MyWebServiceProvider());
> >         ep.setWsdlLocation("test.wsdl");
> >         ep.publish(address);
> >         ep.getService().put("schema-validation-enabled", "true");
> >
> > then the publish fails because it ends up in
> > buildServiceFromWSDL(). If I try it this way:
> >
> >         EndpointImpl ep = (EndpointImpl)Endpoint.create(new
> > MyWebServiceProvider());
> >         ep.publish(address);
> >         ep.setWsdlLocation("test.wsdl");
> >         ep.getService().put("schema-validation-enabled", "true");
> >
> > then the schema validation doesn't happen. I assume this is
> > because setWsdlLocation doesn't really do anything useful
> > *after* the endpoint is already published.
> >
> > So, I'm thinking there must be a way to associate the wsdl
> > (or at least its schema) with the endpoint, but not try to
> > build the endpoint from the wsdl. Any suggestions?
> >
> > Thanks,
> >
> > Lee



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

Mime
View raw message