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

 

Reply via email to