Hi,

ESB 4.8.1
I have been testing the following 2 scenarios in a fresh ESB 4.8.1 pack.

As per my observations the header tag extracted is behaving in two
different ways in the following
two scenarios.

*Proxy*
<proxy name="PayloadFactoryHeaderTest"
          transports="http"
          startOnLoad="true"
          trace="disable">
      <target>
         <inSequence>
            <loopback/>
         </inSequence>
         <outSequence>
            <log level="full"/>
            <payloadFactory media-type="xml">
               <format>
                  <theData xmlns="http://some.namespace";>
                     <theHeader>$1</theHeader>
                     <theBody>$2</theBody>
                  </theData>
               </format>
               <args>
                  <arg evaluator="xml" expression="$header/*"/>
                  <arg evaluator="xml" expression="$body/*"/>
               </args>
            </payloadFactory>
            <log level="full"/>
            <send/>
         </outSequence>
      </target>
   </proxy>

*scenario 1*
*SOAP request*
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
   <soap:Header>
      <hd:inHeaderA xmlns:hd="http://some.namespace
">InputHeaderValueA</hd:inHeaderA>
      <hd:inHeaderB xmlns:hd="http://some.namespace
">InputHeaderValueB</hd:inHeaderB>
   </soap:Header>
   <soap:Body>
      <input xmlns="http://some.namespace";>
         <customData1>inputData1</customData1>
         <customData2>inputData2</customData2>
      </input>
   </soap:Body>
</soap:Envelope>

*Response*
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
   <soap:Header>
      <hd:inHeaderA xmlns:hd="http://some.namespace
">InputHeaderValueA</hd:inHeaderA>
      <hd:inHeaderB xmlns:hd="http://some.namespace
">InputHeaderValueB</hd:inHeaderB>
   </soap:Header>
   <soap:Body>
      <theData xmlns="http://some.namespace";>
         <theHeader>*InputHeaderValueAInputHeaderValueB*</theHeader>
         <theBody>
            <input>
               <customData1>inputData1</customData1>
               <customData2>inputData2</customData2>
            </input>
         </theBody>
      </theData>
   </soap:Body>
</soap:Envelope>

*scenario 2*
*SOAP request*
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
   <soap:Header>
      <hd:inHeaderA xmlns:hd="http://some.namespace";>
         <sub>InputHeaderValueA</sub>
      </hd:inHeaderA>
      <hd:inHeaderB xmlns:hd="http://some.namespace";>
         <sub>InputHeaderValueB</sub>
      </hd:inHeaderB>
   </soap:Header>
   <soap:Body>
      <input xmlns="http://some.namespace";>
         <customData1>inputData1</customData1>
         <customData2>inputData2</customData2>
      </input>
   </soap:Body>
</soap:Envelope>

*Response*
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
   <soap:Header>
      <hd:inHeaderA xmlns:hd="http://some.namespace";>
         <sub>InputHeaderValueA</sub>
      </hd:inHeaderA>
      <hd:inHeaderB xmlns:hd="http://some.namespace";>
         <sub>InputHeaderValueB</sub>
      </hd:inHeaderB>
   </soap:Header>
   <soap:Body>
      <theData xmlns="http://some.namespace";>
         <theHeader>
            *<hd:inHeaderA xmlns:hd="http://some.namespace
<http://some.namespace>">*
*               <sub>InputHeaderValueA</sub>*
*            </hd:inHeaderA>*
*            <hd:inHeaderB xmlns:hd="http://some.namespace
<http://some.namespace>">*
*               <sub>InputHeaderValueB</sub>*
*            </hd:inHeaderB>*
         </theHeader>
         <theBody>
            <input>
               <customData1>inputData1</customData1>
               <customData2>inputData2</customData2>
            </input>
         </theBody>
      </theData>
   </soap:Body>
</soap:Envelope>

Here, the header with sub elements is extracted successfully with tags
(scenario 2), whereas the header with a single element (without any sub
elements in scenario 1) has failed to extract the tags in the payload.

Shouldn't the behaviour of ESB be consistent in both the scenarios?

Thanks,
Suhan



-- 
Suhan Dharmasuriya
Software Engineer - Test Automation

*WSO2, Inc. *

lean . enterprise . middleware
Tel: +94 112 145345
Mob: +94 779 869138
Blog: http://suhan-opensource.blogspot.com/
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to