Talend - 检查tEsbConsumer Soap响应并计算具有相同名称的字段

时间:2018-05-21 08:48:43

标签: xml soap talend

我正在尝试检查来自tEsbConsumer活动的响应是否包含多个具有特定名称的标记。让我们假设响应如下:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <ns1:CustomerSearchResponse xmlns="http://test.com/CustomerSearchResponse/" xmlns:ns1="http://test.com/CustomerSearchResponse/">
         <ns1:Success>
            <ns1:Customers>
               <ns1:Customer>
                  <ns1:CustomerId>12</ns1:CustomerId>
                  <ns1:Surname>Sur1</ns1:Surname>
               </ns1:Customer>
               <ns1:Customer>
                  <ns1:CustomerId>34</ns1:CustomerId>
                  <ns1:Surname>Sur2</ns1:Surname>
               </ns1:Customer>
            </ns1:Customers>
         </ns1:Success>
      </ns1:CustomerSearchResponse>
   </soapenv:Body>
</soapenv:Envelope>

TalendESB中的代码如下所示:

Talend Code

根据返回的客户数量,我想将邮件重定向到不同的行。带count()变量的附加变量也适合我。 txmlmap中的xpath不起作用,tXSLT转换器需要输入文件而tExtractXMLField不能以这种形式工作:

tExtractXMLField mapping

有人知道该怎么做吗?

0 个答案:

没有答案