0

在我的 BPEL 中,我在 catch 块中发现了一个错误。在 catch 块中,我有一个分配活动,它将输入有效负载(数据)映射到故障变量并填充 jms 队列。从该 jms 队列中,另外一项服务获取数据并发送错误邮件。现在在错误邮件中,我得到的有效负载为:

<sal:salesUser xmlns:sal="http://www.mycompany.com/schemas/SalesUserMessage"> <!--Optional: -->
<sal1:userID xmlns:sal1="http://www.mycompany.com/schemas/SalesUserObject">123ABC</sal1:userID>
</sal:salesUser>

但是,如果我检查流跟踪,则有效负载看起来像这样,我相信应该在我的邮件中获取以下没有 URls 的数据:

<sal:syncSalesUser>
<!-- Optional:
                 -->
<sal1:userID>123ABC</sal1:userID>
<!-- Optional:
                 -->
</sal:syncSalesUser>

请告诉我为什么我在邮件的 xml 标记中获取 url。

PFB 我抓黑的分配部分:

<catch faultName="bpelx:remoteFault" faultVariable="RuntimeFaultVar">
  <sequence name="seq_RemoteFault">
    <assign name="assign_RemotefaultMessage">
      <copy>
        <from expression="oraext:get-content-as-string(bpws:getVariableData('receiveInput_InVar','userNotify','/ns22:userNotify/ns22:payload/ns22:user'))"/>
        <to variable="FaultMessage" part="payload"
            query="/ns7:FaultSchema/ns7:FaultMessage/ns7:Payload"/>
      </copy>
    </assign>
    <invoke name="publish_RemoteFaultToQueue"
            partnerLink="publish_ErrorToQueue"
            portType="ns3:Produce_Message_ptt" operation="Produce_Message"
            inputVariable="invoke_jms_publish_ErrorToQueue"/>
    <terminate name="Terminate"/>
  </sequence>

提前致谢。

4

1 回答 1

0

如果你想要你想要的输出,你应该考虑使用 xquery 来摆脱所有的命名空间。

试试下面的 xquery:

xquery version "1.0" encoding "Cp1252";
(:: pragma  parameter="$anyType1" type="xs:anyType" ::)
(:: pragma  type="xs:anyType" ::)

module namespace xf="http://tempuri.org/Cancel_Order/RemoveNamespace";

declare function xf:strip-namespace($e as element())as element()
{element { fn:QName("",fn:local-name($e)) }
{ for $child in $e/(@*,node())
 return  
 if ($child instance of element())
    then xf:strip-namespace($child)
       else $child
       }
 };

希望能帮助到你

于 2016-10-17T10:54:33.507 回答