cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Freeman Fang (JIRA)" <>
Subject [jira] Commented: (CXF-3233) JAXB xsd validation working on incoming messages but not outgoing messages
Date Fri, 07 Jan 2011 02:36:46 GMT


Freeman Fang commented on CXF-3233:


What the exact value you set for UUID.Content?

I just did a quick test and the outgoing messages validation works for me.
My schema restriction looks like
      <xsd:simpleType name="MyType">
                <xsd:restriction base="xsd:string">
                     <xsd:maxLength value="10" />
Then when I set a string with length 11, then I can see the exception like

WARNING: Interceptor for {}service#{}ckR
has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Marshalling Error: cvc-maxLength-valid: Value 'thisisffang'
with length = '11' is not facet-valid with respect to maxLength '10' for type 'GUIDType'.
	at org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(
	at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(
	at org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
	at org.apache.cxf.endpoint.ClientImpl.invoke(
	at org.apache.cxf.endpoint.ClientImpl.invoke(
	at org.apache.cxf.endpoint.ClientImpl.invoke(
	at org.apache.cxf.frontend.ClientProxy.invokeSync(
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(

So you can see the outgoing message validation works as expected.

Would you please append a whole testcase which I can reproduce the problem?
As the problem you mentioned is on the client side, so you can just append your whole client
side code(with configuration)?
Btw, I guess your server is deployed in weblogic, but your client is standalone, is it correct?


> JAXB xsd validation working on incoming messages but not outgoing messages
> --------------------------------------------------------------------------
>                 Key: CXF-3233
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>          Components: Bus
>    Affects Versions: 2.3.1
>         Environment: webLogic
>            Reporter: Benjamin Shults
>            Assignee: Freeman Fang
> Using CXF 2.3.1.
> Generated Java from WSDLs using JAXB.
> Using 
>     <jaxws:properties>
>         <entry key="schema-validation-enabled" value="true" />
>     </jaxws:properties>
> in the client configuration.
> My test creates an object that fails this particular requirement of the WSDL:
>     <xsd:simpleType name="UUID.Content">
>         <xsd:annotation>
>             <xsd:documentation xml:lang="EN">
>                 Universally Unique Identifier
>                 </xsd:documentation>
>         </xsd:annotation>
>         <xsd:restriction base="xsd:token">
>             <xsd:length value="36" />
>             <xsd:pattern
>                 value="[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
>         </xsd:restriction>
>     </xsd:simpleType>
> However, the message is marshalled and makes it all the way through the outgoing interceptor
> The WSDL is one-way: input-only.
> wsdlLocation is specified in an annotation in the Impls.
> Interestingly, incoming messages that fail validation of this same constraint are blocked
by the interceptor chain during unmarshalling.
> I'm testing on WebLogic.  I could also test on WebSphere is needed.
> Other XSD validation failures (such as a missing required element) are being caught by
the outgoing marshaller.
> The reason that we upgraded to 2.3.1 from 2.2.6 was that we were seeing similar issues
on the inbound messages.  In 2.3.1, complete XSD validation occurs for inbound messages but
not for outbound ones.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message