synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ravi Undupitiya (JIRA)" <j...@apache.org>
Subject [jira] [Created] (SYNAPSE-1007) Enrich mediator does not enrich the message body when clone is set to 'false' and source type is set to 'property'
Date Sat, 21 May 2016 06:31:12 GMT
Ravi Undupitiya created SYNAPSE-1007:
----------------------------------------

             Summary: Enrich mediator does not enrich the message body when clone is set to
'false' and source type is set to 'property'
                 Key: SYNAPSE-1007
                 URL: https://issues.apache.org/jira/browse/SYNAPSE-1007
             Project: Synapse
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.1
            Reporter: Ravi Undupitiya
            Assignee: Hiranya Jayathilaka
             Fix For: 2.1, FUTURE


If we try to enrich the a body with a property (where property type is set to 'OM') while
setting clone to false, messages is not enriched.

To illustrate this, consider the following synapse configuration.

{code}
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://ws.apache.org/ns/synapse">
   <proxy name="SYNAPSE1007" transports="https,http" statistics="disable" trace="disable"
startOnLoad="true">
      <target>
         <inSequence>
            <log level="custom">
               <property name="SYNAPSE-1007" value="Bond, James Bond" />
            </log>
            <property name="PAYLOAD" expression="//payload/content" type="OM" />
            <enrich>
               <source type="property" clone="false" property="PAYLOAD" />
               <target type="body" />
            </enrich>
            <header name="To" action="remove" />
            <property name="RESPONSE" value="true" scope="default" type="STRING" />
            <property name="NO_ENTITY_BODY" scope="axis2" action="remove" />
            <send />
         </inSequence>
      </target>
      <description />
   </proxy>
</definitions>{code}

Sending the following request:

{code}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header/>
   <soapenv:Body>
      <payload>
         <content>
            <abc>
               <def>ABC</def>
            </abc>
         </content>
      </payload>
   </soapenv:Body>
</soapenv:Envelope>
{code}

Yields:

{code}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <payload>
         <content>
            <abc>
               <def>ABC</def>
            </abc>
         </content>
      </payload>
   </soapenv:Body>
</soapenv:Envelope>
{code}

But the expected response should be

{code}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <content>
         <abc>
            <def>ABC</def>
         </abc>
      </content>
   </soapenv:Body>
</soapenv:Envelope>
{code}

I've attached a fix for this issue (built against 2.1 branch) for you consideration. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


Mime
View raw message