Soap Mule MtoM传输出站验证错误
在Jboss 7中运行的业务服务中添加启用MtoM后,我们发现通过Mule传递soap请求现在会导致错误:-Soap Mule MtoM传输出站验证错误,soap,mule,mtom,Soap,Mule,Mtom,在Jboss 7中运行的业务服务中添加启用MtoM后,我们发现通过Mule传递soap请求现在会导致错误:- <faultstring>An exception occurred while invoking message processor "DefaultMessageProcessorChain '(inner iterating chain) of OutboundEndpoint 'http://127.0.0.1:8280/communication' request
<faultstring>An exception occurred while invoking message processor "DefaultMessageProcessorChain '(inner iterating chain) of OutboundEndpoint 'http://127.0.0.1:8280/communication' request chain'
[
org.mule.endpoint.outbound.OutboundEventTimeoutMessageProcessor,
org.mule.endpoint.outbound.OutboundSessionHandlerMessageProcessor,
org.mule.endpoint.outbound.OutboundEndpointPropertyMessageProcessor,
org.mule.endpoint.outbound.OutboundResponsePropertiesMessageProcessor
]" with transaction "Transaction{factory=null, action=NEVER, timeout=0}".. Message payload is of type: PostMethod</faultstring>
调用OutboundEndpoint的消息处理器“DefaultMessageProcessorChain”(内部迭代链)时发生异常http://127.0.0.1:8280/communication“请求链”
[
org.mule.endpoint.outbound.OutboundEventTimeoutMessageProcessor,
org.mule.endpoint.outbound.OutboundSessionHandlerMessageProcessor,
org.mule.endpoint.outbound.OutboundEndpointPropertyMessageProcessor,
org.mule.endpoint.outbound.OutboundResponseProperties消息处理器
]“具有事务”事务{factory=null,action=NEVER,timeout=0}“。。消息负载的类型为:PostMethod
这似乎是由验证错误引起的,该错误发生在服务响应的有效负载在传递回SOAPUI之前被验证时。检查Mule日志文件时,会记录以下内容:
Caused by: org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:222)
at ... 80 more
Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '-' (code 45) in prolog; expected '<'
at [row,col {unknown-source}]: [1,1]
at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:644)
at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2003)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1100)
at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1123)
at org.mule.module.xml.stax.DelegateXMLStreamReader.nextTag(DelegateXMLStreamReader.java:242)
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:122)
... 90 more
原因:org.apache.cxf.binding.soap.SoapFault:读取XMLStreamReader时出错。
位于org.apache.cxf.binding.soap.interceptor.ReadHeaderInterceptor.handleMessage(ReadHeaderInterceptor.java:222)
在80多
原因:com.ctc.wstx.exc.WstxUnexpectedCharException:prolog中的意外字符“-”(代码45);预期“我以前见过类似的情况,因为CXF代理正在将内容类型从multipart/related更改;type=“应用程序/xop+xml”。。。。。在响应上选择“文本/普通”
您可以记录内容类型,并尝试手动设置或复制内容类型,类似于:
<code>
<message-properties-transformer>
<add-message-property key="Content-Type" value="#[header:Content-Type]" />
</message-properties-transformer>
</code>
然后向下滚动或搜索“wstx”Magic!谢谢,这种内容类型是一个很好的地方。mulesoft链接似乎不再有效:(…你有新的链接吗?
<!-- Primary Choice router is used to forward requests to the wsdl proxy
and SOAPflow this should be the only endpoint that is exposed to the public
domain. -->
<flow name="SOAInboundRouter">
<!-- public inbound listener -->
<inbound-endpoint address="${web.inboundAddress}"
exchange-pattern="request-response" />
<!-- Outbound filter for routing requests -->
<choice>
<when>
<regex-filter pattern="soap" />
<outbound-endpoint
address="${soa.inboundAddress}#[header:inbound:http.request]"
exchange-pattern="request-response" />
</when>
</choice>
</flow>
<!-- Flow used for SOAP request processing, this implements a callback to
check the SOAP header for the correct username token for WS-Security request
are passed to this flow by the Flow SOAInboundRouter. This endpoint is not
for use in the public domain. -->
<flow name="SoapFlow">
<!-- http listener for SOAP requests -->
<inbound-endpoint address="${soa.inboundAddress}"
exchange-pattern="request-response">
<cxf:proxy-service service="" namespace="">
<!-- WS-Security intercetor applied to the inbound request -->
<cxf:inInterceptors>
<spring:ref bean="cxfSecurityInterceptor" />
</cxf:inInterceptors>
</cxf:proxy-service>
</inbound-endpoint>
<!--Success on authentication request is passed to outbound router this
is the actual service -->
<outbound-endpoint
address="${soa.outboundAddress}#[header:inbound:http.request]"
exchange-pattern="request-response">
<cxf:proxy-client />
</outbound-endpoint>
</flow>
<!-- application configuration -->
<spring:bean id="cxfSecurityInterceptor"
class="uk.co.weatherbys.security.esb.cxf.CXFSecurityInterceptor"
scope="prototype">
<spring:constructor-arg value="${mule.userfile}" />
<spring:property name="wServiceHeaderDelegate" ref="wServiceHeaderDelegate" />
<spring:property name="cxfWsSecurityDelegate" ref="cXfWsSecurityDelegate" />
</spring:bean>
<spring:bean id="wServiceHeaderDelegate"
class="uk.co.weatherbys.security.esb.cxf.WServiceHeaderDelegate">
</spring:bean>
<spring:bean id="cXfWsSecurityDelegate"
class="uk.co.weatherbys.security.esb.cxf.CxfWsSecurityDelegate">
</spring:bean>
<code>
<message-properties-transformer>
<add-message-property key="Content-Type" value="#[header:Content-Type]" />
</message-properties-transformer>
</code>