WSO2:重写响应

WSO2 : rewrite response

重写一个return流程时遇到问题,我在这里创建了点(),没问题。 我尝试重写我的输出流,但是当我进行输出时,重写的流与流的所有其余部分一起存在。我不只是有我重写的流。

中介是:

<property name="XMLBody" 
    expression="$body//soap:Body//generic:xmlpres" 
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:gce="urn:GCE" 
   xmlns:generic="http://www.generix.fr/technicalframework/businesscomponent/applicationmodule/common" type="OM" />
<!-- pass the extracted property as response body -->
<enrich>
    <source type="property" property="XMLBody" />
    <target type="body" />
</enrich>

<property name="XMLBody2" 
    expression="$body//VueTable"  type="OM" />
<!-- pass the extracted property as response body -->
<enrich>
    <source type="property" property="XMLBody2" />
    <target type="body" />
</enrich>
<foreach expression="$body//JTblViewRow">
    <sequence>
       <payloadFactory media-type="xml">
          <format>
             <TABLE xmlns="">
                <Code></Code>
                <Libelle></Libelle>
             </TABLE>
          </format>
          <args>
             <arg evaluator="xml" expression="//Cletbl/business_data"/>
             <arg evaluator="xml" expression="//Lib1/business_data"/>
          </args>
       </payloadFactory>
    </sequence>
 </foreach>
 <property name="ContentType" value="text/xml" scope="axis2"/>

输出:

<VueTable type="View" name="Table" habctr="true" total_business_row="2" nbline="400" confNbline="400" numpage="1" nbpage="1">
               <JTblView name="JTblView" type="ViewObject" maxfetchsize="999" maxfetchsizeexceeded="false"><TABLE><Code>N</Code><Libelle>Non</Libelle></TABLE><TABLE><Code>O</Code><Libelle>Oui</Libelle></TABLE></JTblView>
            </VueTable>

现在可以了!

<enrich>
        <source type="inline" clone="true">
            <Tables xmlns=""/>
         </source>
         <target type="property" property="Tables"/>
     </enrich>
    

    <foreach expression="$body//JTblViewRow">
        <sequence>
           <payloadFactory media-type="xml">
              <format>
                <Table xmlns="">
                    <Code></Code>
                    <Libelle></Libelle>
                </Table>
              </format>
              <args>
                 <arg evaluator="xml" expression="//Cletbl/business_data"/>
                 <arg evaluator="xml" expression="//Lib1/business_data"/>
              </args>
           </payloadFactory>
            <enrich>
                <source clone="true" xpath="//Table"/>
                 <target action="child" xpath="$ctx:Tables"/>
               </enrich>
        </sequence>
     </foreach>

 <enrich>
        <source clone="true" xpath="$ctx:Tables"/>
        <target type="body"/>
 </enrich>