簡體   English   中英

通過WSO2 esb中的Payload Mediator傳遞所有默認響應值

[英]Pass all default response values through Payload Mediator in WSO2 esb

我在WSO2 ESB上部署的代理服務中使用有效負載介體,以將舊值映射到新值。 它工作正常,但只顯示我已轉換的值。 我希望它也顯示其余的響應。 無論如何,可以使用有效負載中介程序或任何其他中介程序來做到這一點嗎?

WSDL:

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="Person_Proxy"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
   <target>
      <inSequence>
         <send>
            <endpoint>
               <address uri="http://www.example.com/xsd/Person_01_RequestResponse_001"/>
            </endpoint>
         </send>
      </inSequence>
      <outSequence>
         <payloadFactory media-type="xml">
            <format>
               <m:GetPersonResponse xmlns:m="http://example.com/TimeWriter/Person">
                  <m:NationalIdentityNumber>$1</m:NationalIdentityNumber>
                  <m:CountryCode>$2</m:CountryCode>
                  <m:FirstName>$3</m:FirstName>
                  <m:LastName>$4</m:LastName>
                  <m:HomePhone>$5</m:HomePhone>
               </m:GetPersonResponse>
            </format>
            <args>
               <arg xmlns:m0="http://www.example.com/xsd/Person_01"
                    evaluator="xml"
                    expression="//m0:CNIC"/>
               <arg xmlns:m0="http://www.example.com/xsd/Person_01"
                    evaluator="xml"
                    expression="//m0:Country"/>
               <arg xmlns:m0="http://www.example.com/xsd/Person_01"
                    evaluator="xml"
                    expression="//m0:FirstName"/>
               <arg xmlns:m0="http://www.example.com/xsd/Person_01"
                    evaluator="xml"
                    expression="//m0:LastName"/>
               <arg xmlns:m0="http://www.example.com/xsd/Person_01"
                    evaluator="xml"
                    expression="//m0:HomePhone"/>
            </args>
         </payloadFactory>
         <send/>
      </outSequence>
      <endpoint>
         <address uri="http://localhost:8080/Person_01/services/PersonSOAP"/>
      </endpoint>
   </target>
   <description/>
</proxy>

作為響應,我現在只得到了四個屬性,這些屬性已經明確地轉換了。 我也想要其余的屬性。 我正在使用SoapUI工具來測試此服務。

您可以嘗試多種選擇,例如,使用xslt介體,腳本介體,也可以使用自己的自定義介體來實現此轉換邏輯。 如果您打算僅使用有效負載中介程序,則必須修改有效負載工廠以包括所有內容,它僅輸出您在“格式”標簽之間指定的內容,僅此而已。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM