[ 
https://issues.apache.org/jira/browse/CXF-3233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12978618#action_12978618
 ] 

Freeman Fang commented on CXF-3233:
-----------------------------------

Hi,

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" />
                </xsd:restriction>
        </xsd:simpleType>
Then when I set a string with length 11, then I can see the exception like

WARNING: Interceptor for 
{http://cxf.apache.org/jaxws/schemavalidation}service#{http://cxf.apache.org/jaxws/schemavalidation}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(JAXBEncoderDecoder.java:252)
        at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:169)
        at 
org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:110)
        at 
org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)
        at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
        at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
        at 
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)

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?

Freeman

> JAXB xsd validation working on incoming messages but not outgoing messages
> --------------------------------------------------------------------------
>
>                 Key: CXF-3233
>                 URL: https://issues.apache.org/jira/browse/CXF-3233
>             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 chain.
> 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.

Reply via email to