简体   繁体   English

获取有关WSO2的数据响应

[英]Get data response on WSO2

I have received an message response in WSO2 from Endpoint when i send the data. 发送数据时,我在Endpoint的WSO2中收到了消息响应。 Im newbie in WSO2. 我是WSO2的新手。 Can you show me how to get the value of Job tag (00000559) on message? 您能告诉我如何在消息中获取Job标签(00000559)的值吗?

Below is received message. 以下是收到的消息。

Thanks & Regards, 感谢和问候,

 [2013-08-24 13:25:08,295]  INFO - LogMediator To: , WSAction: http://www.abc.com/ns/transaction/Post, SOAPAction: http://www.abc.com/ns/transaction/Post,
    MessageID: urn:uuid:1e939de3-3ade-4aea-afdf-9e1defcae760, Direction: response, Envelope: <?xml version='1.0' encoding='utf-8'?><soap:Envelope xmlns:soap="http:/
    /schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><PostResponse
     xmlns="http://www.syspro.com/ns/transaction/"><PostResult>&lt;?xml version="1.0" encoding="Windows-1252"?>
    &lt;postjob Language='05' Language2='EN' CssStyle='' DecFormat='1' DateFormat='01' Role='01' Version='6.1.058' OperatorPrimaryRole='   '>
    &lt;Item>
    &lt;Job>00000559&lt;/Job>
    &lt;ItemNumber>         1&lt;/ItemNumber>
    &lt;/Item>
    &lt;StatusOfItems>
    &lt;ItemsProcessed>1&lt;/ItemsProcessed>
    &lt;ItemsInvalid>0&lt;/ItemsInvalid>
    &lt;/StatusOfItems>
    &lt;/postjob>
     </PostResult></PostResponse></soap:Body></soap:Envelope>

You can use XPATH expressions to get the value of any tag. 您可以使用XPATH表达式来获取任何标签的值。

If you need to log the value in job tag, use below in the out sequence 如果需要将值记录在作业标签中,请按以下顺序使用

<log>
        <property name="VM_LOG" expression="//PostResponse//PostResult//postjob//Item/Job"/>
     </log>

If you need to send it as the response, you can simply use the payload factory mediator inside the out sequence 如果您需要将其发送为响应,则只需在out序列内使用有效负载工厂中介程序即可

     <payloadFactory media-type="xml">
        <format>
           <results xmlns="">$1</results>
        </format>
        <args>
           <arg evaluator="xml" expression="//PostResponse//PostResult//postjob//Item/Job"/>
        </args>
     </payloadFactory>

Finally you can add the send mediator. 最后,您可以添加发送介体。

<send/>

Thanks. 谢谢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM