You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by "Ravi Undupitiya (JIRA)" <ji...@apache.org> on 2016/05/21 06:31:12 UTC

[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'

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