本文介绍了为什么Mule返回WSDL soapAction作为双引号字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的任务是根据soapAction将消息路由到不同的jms队列.我正在使用<cxf:proxy-service>,因此除了在WSDL中填充soapAction属性外,没有其他方法可以找到被调用的操作(除非有人告诉我).所以这就是我想要达到的目的:

I've the task of routing message to different jms queues based on the soapAction. I'm using <cxf:proxy-service> so basically there is no other way to find what operation was invoked other than populating soapAction attribute in WSDL (unless someone tells me otherwise). So this is what I was trying to achieve:

<choice>
  <when expression="message.inboundProperties['SOAPAction'] == 'submitOrderStatus'">
    <jms:outbound-endpoint queue="mviq.1122.result" />
  </when>
 ....
</choice>

但是,即使我使用记录器打印下面显示的表达式,上面的代码也不会得出true,我会得到"submitOrderStatus"

But the above code does not evaluate to true even though if I print the expression shown below using logger, I get "submitOrderStatus"

<logger message="SoapAction is #[message.inboundProperties['SOAPAction']]" level="INFO" />

敲了我的头太长时间并且剖析了几个小时的日志文件后,我意识到除SOAPAction之外,所有属性值均未引用.因此,将流程更改为此可以节省我:

After banging my head for too long and hours of dissection of log files, I realized that all the values of properties are unquoted except for SOAPAction. So changing my flow to this saved me:

<when expression="message.inboundProperties['SOAPAction'] == '&quot;submitOrderStatus&quot;'">
    <logger message="Can evaluate this message.inboundProperties['SOAPAction'] == '&quot;submitOrderStatus&quot;'" level="INFO" />
    <jms:outbound-endpoint queue="mviq.1122.result" />
</when>

我很好奇为什么Mule返回SoapAction作为双引号字符串

I'm very curious to know why does Mule returns SoapAction as double quoted String

编辑:SoapUI通过网络发送此消息.我不确定为什么要引用SOAPAction.

SoapUI send this over the wire. I'm not sure why SOAPAction is quoted.

POST http://localhost:61005/mvi/service HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "submitOrderStatus"
Content-Length: 5355
Host: localhost:61005
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)`  

下面是我的wsdl的一部分:

Below is part of my wsdl:

<wsdl:operation name="submitOrderStatus">
     <soap:operation soapAction="submitOrderStatus" style="document"/>
     <wsdl:input name="submitOrderStatusRequest">
        <soap:body use="literal"/>
     </wsdl:input>
     <wsdl:output name="submitOrderStatusResponse">
        <soap:body use="literal"/>
     </wsdl:output>
  </wsdl:operation>

推荐答案

这是不正确的:请参见答案 https://stackoverflow,以了解如何从cxf_operation流变量获取操作. com/a/14163660/387927

This is not correct: see how I get the operation from the cxf_operation flow variable in my answer https://stackoverflow.com/a/14163660/387927

SOAPAction标头按规范引用: http://www.w3.org /TR/soap11/#_ Toc478383528

SOAPAction headers are quoted as per the spec: http://www.w3.org/TR/soap11/#_Toc478383528

所以您的表情应该是:

<when expression="#[message.inboundProperties['SOAPAction'] == '&quote;submitOrderStatus&quote;']">

这篇关于为什么Mule返回WSDL soapAction作为双引号字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-12 05:41