【问题标题】:How can i get the XML values in mule?如何获取 mule 中的 XML 值?
【发布时间】:2015-07-22 00:04:05
【问题描述】:

在 Mule 中,我使用的是 SOAP 组件,它接收 XML 格式的 WSDL 文件。之后我想获取 XML 数据。但它显示错误。我在这里使用

#[message.InboundProperties['Subject']]

它显示空值。这是我的 XML 代码

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:out="http://soap.sforce.com/2005/09/outbound" xmlns:urn="urn:sobject.enterprise.soap.sforce.com">
   <soapenv:Header/>
   <soapenv:Body>
      <out:notifications>
         <out:OrganizationId>00D9XXXXXXXXXXXx</out:OrganizationId>
         <out:ActionId>04k90xxxxxx</out:ActionId>
         <out:SessionId>XXXXXXXXXXXXXXX</out:SessionId>
         <out:EnterpriseUrl>https://ap1.salesforce.com/services/Soap/c/29.0/00D90000000q0Mc</out:EnterpriseUrl>
         <out:PartnerUrl>https://ap1.salesforce.com/services/Soap/u/29.0/00D90000000q0Mc</out:PartnerUrl>
         <!--1 to 100 repetitions:-->
         <out:Notification>
            **<out:Id>?</out:Id>
            <out:sObject>
               <!--Zero or more repetitions:-->
               <urn:fieldsToNull>?</urn:fieldsToNull>
                <!--Optional:-->
               <urn:Subject>Test</urn:Subject>
            </out:sObject>**
         </out:Notification>
      </out:notifications>
   </soapenv:Body>
</soapenv:Envelope>

SOAP 工作正常。 &lt;urn:Subject&gt;Test&lt;/urn:Subject&gt; 此 XML 文件中的主题值

【问题讨论】:

    标签: mule mule-studio mule-el mule-module-jpa


    【解决方案1】:

    你能澄清你的问题吗:

    您是否在尝试运行程序或从 SOAP 客户端调用时遇到错误? 你能粘贴你的骡子代码吗? 如果您希望在 SOAP 消息处理器 (MP) 之后将 XML 作为您的有效负载,您需要在 SOAP MP 中将操作设置为“代理服务”。

    【讨论】:

    • 现在 Flow 工作正常。为了接收 XML 节点,我正在使用 XPATH 但它只支持 LocalSystem 我如何使用在线。它显示在线工作时间的错误。
    • 抱歉,LocalSystem - mule Studio 是什么意思?你能为我添加错误吗?
    • localhost:8081 这个地址适用于 xpath。但它不适用于 URL。好的,你能告诉我如何检索 xml 节点值。我已经根据这种格式粘贴了我的 xml 代码格式,我应该使用 XPATH 接收该值。我该怎么办?
    【解决方案2】:

    由于 XML 是 SOAP,要提取节点值,您需要使用 XPATH http://blogs.mulesoft.com/mule-3-6-xml-xpath-xslt-xquery3/
    和 Mule 命名空间管理器 https://developer.mulesoft.com/docs/display/current/XML+Namespaces

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-01-26
      • 2015-03-19
      • 2015-02-27
      • 2018-09-15
      • 1970-01-01
      • 2020-02-29
      • 2015-07-15
      相关资源
      最近更新 更多