cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: Enabling jaxws schema validation through CXF?
Date Tue, 14 Dec 2010 20:37:36 GMT

Thanks for the report.   I just fixed the wsdl_first_soap12 to properly 
validate with the -Pserver flag.    The key was the  log entry of:

Creating Service {http://apache.org/hello_world_soap12_http}SOAPService from 
class ......

instead of saying "from WSDL".   The way it was being started, it wasn't using 
the wsdl so it couldn't really validate.   I've changed how it's started and 
added the new @SchemaValidation annotation an it now works.  You can grab it 
all from:
http://svn.apache.org/repos/asf/cxf/trunk/distribution/src/main/release/samples/wsdl_first_soap12/
if you want.

Dan


On Tuesday 14 December 2010 12:46:49 pm Pieper, Aaron wrote:
> Hello,
> 
> 
> 
> I am trying to enable incoming schema validation on a CXF endpoint. I
> know this is a very common question. I am using CXF 2.3.0. I tried
> adding the annotation to my web service, and I also tried the
> "jaxws:properties" approach, modifying my cxf-servlet file. Both of
> those approaches worked, kind of - but they only enable outgoing
> validation. Incoming messages are still unvalidated, and I'm not sure
> why.
> 
> 
> 
> I'm 90% sure the problem is on my side, so my real question is - is
> there one of the code samples in CXF which I can easily tweak to enable
> validation, so that I can see how it's supposed to work? Or are there
> any of the examples which already have validation enabled? The closest
> thing I could find was the wsdl-first examples, which are a little
> broken I think.
> 
> 
> 
> The "wsdl_first_soap12" Client.java has a try/catch block which says
> something along the lines of, "Invoking greetMe with invalid length
> string, expecting exception..." but, the exception isn't thrown, and the
> test passes anyways, since there's no "Assert.fail" in the try block.
> 
> 
> 
> I also looked at the "wsdl_first" project because its cxf.xml had the
> jaxws validation tags in it. The wsdl_first project didn't work out of
> the box, because the pom.xml file referenced a "hello_world.wsdl" which
> didn't exist. After fixing that, though, schema validation is still not
> enabled - it seems like the "mvn -Pserver" sidesteps the cxf.xml
> configuration file, the endpoint is configured in the
> CustomerServiceServer.java file.
> 
> 
> 
> What is the easiest way to get an example up and running with incoming
> schema validation? I have been running most of the examples with the
> "mvn -Pserver" approach which seems like it would not activate any of
> the annotations or any of the CXF configuration files which trigger
> validation. Do I have to modify one of the examples to enable XSD
> validation, launch a standalone tomcat instance, build a war file, and
> deploy the war file into that instance? Or is there a simpler way?
> 
> 
> 
> Thanks,
> 
> 
> 
> - Aaron

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

Mime
View raw message