1

我在 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 工具来测试这项服务。

4

1 回答 1

1

您可以尝试多种选择,即使用 xslt 调解器、脚本调解器,或者您可以拥有自己的自定义调解器来实现此转换逻辑。如果您打算仅使用有效负载调解器,则必须修改有效负载工厂以包含所有内容,它仅输出您在“格式”标签之间指定的内容,仅此而已。

于 2014-10-16T10:01:02.283 回答