On Nov 1, 2012, at 5:29 AM, jbaker.c <john.ba...@camelotgroup.co.uk> wrote:

> I attach a test case that I modified from a previous JIRA
> (https://issues.apache.org/jira/browse/CXF-4334). It sets two values that do
> not meet the restriction set out in the schema yet the request is not
> rejected, ie no SOAP Fault is generated. If the values are null, an
> exception is thrown as expected (because the element is missing as per the
> schema).
> 
> cxf-header-validation-testcase.zip
> <http://cxf.547215.n5.nabble.com/file/n5717681/cxf-header-validation-testcase.zip>
>   
> 


This is a problem with the test case.  It's not using the wsdl for the service 
and thus is generating a new schema at runtime based on the annotations.  JAXB 
doesn't have any annotations for the various facet restrictions and such so 
that information is lost.  

If you update the @WebService annotation to:

@WebService(serviceName = "Hello_Service", targetNamespace = 
"http://www.examples.com/wsdl/HelloService.wsdl";)


and then update the ws-context.xml to add:
wsdlLocation="classpath:hello.wsdl" 

to the jaxws:endpoint, then your test passes.  The fault is raised.


-- 
Daniel Kulp
dk...@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to