[
https://issues.apache.org/jira/browse/CXF-7952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17021144#comment-17021144
]
Freeman Yue Fang commented on CXF-7952:
---------------------------------------
I reproduced this issue with a testcase.
The messy http/mtom header is caused by that the AttachmentoutIntercepter get
invoked twice. Once for the normal OutChain, once for the OutFaultChain after
running into schemavalidation exception.
working on a fix
> MTOM + schema validation creates invalid SOAP FAULT response
> ------------------------------------------------------------
>
> Key: CXF-7952
> URL: https://issues.apache.org/jira/browse/CXF-7952
> Project: CXF
> Issue Type: Bug
> Components: JAX-WS Runtime, JAXB Databinding
> Affects Versions: 3.2.6, 3.2.7
> Environment: The service itself is running as a WAR deployment on
> Ubuntu 16.04 LTS within a Apache Tomcat 8.5.32 using JDK 1.8.0_161.
> Reporter: Tobias Held
> Assignee: Freeman Yue Fang
> Priority: Major
> Labels: mtom, soapfault, validation, wsdl
> Attachments: client_fault.txt, error.txt, server_validation.txt
>
>
> Hello! We had built a jaxws webservice based on cxf 3.2.6/3.2.7. The Java
> code was created from a given WSDL by using the maven plugin
> "cxf-codegen-plugin". In the provided _cxf-servlet.xml_ on server side there
> is both _mtom_ and _schema validation_ enabled on the _jaxws:endpoint_
> definition:
> {code:java}
> <jaxws:properties>
> <entry key="schema-validation-enabled" value="true" />
> <entry key="mtom-enabled" value="true"/>
> </jaxws:properties>
> {code}
> In case of an invalid validation result (see attachment
> _server_validation.txt_) it seems, that the created SOAP FAULT message is
> corrupt so that the client could not parse the message (see attachment
> _error.txt_):
> {code:java}
> javax.xml.ws.soap.SOAPFaultException: Error reading XMLStreamReader:
> Unexpected character '-' (code 45) in prolog; expected '<'
> at [row,col {unknown-source}]: [2,1]
> [...]
> Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character
> '-' (code 45) in prolog; expected '<'
> at [row,col {unknown-source}]: [2,1]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:653)
> at
> com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2133)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1181)
> at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1204)
> at
> org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:173){code}
> The message itself seems to contain an additional, non referenced boundary
> (see attachment _client_fault.txt_).
> What might be the problem here? If we deactivate the complete MTOM feature by
> removing it from the endpoint definition the fault message could be
> successfully processed.
> Thanks in andvance!
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)