2

[WSO2 ESB V4.5.0] What is wrong with how I'm configuring the enrich mediator to accumulate XML? I have a sequence of n PojoMediators that retrieve XML from a database with each setting a context property with the XML represented as a string. For example, after the first PojoMediator executes, its' context property is set to:

  customerInformation = <cust><id>1</id><oc></oc><ca>0</ca></cust>

and I'm trying to enrich the body with that XML content but end up with:

[snip]
  </header>
&lt;cust>&lt;id>1&lt;/id>&lt;oc>&lt;/oc>&lt;ca>0&lt;/ca>&lt;/cust></root></soapenv:Body></soapenv:Envelope> {org.apache.synapse.mediators.builtin.LogMediator}

..where the enrich mediator is escaping the referenced "custInfo" XML. My enrich configuration is:

<enrich>
    <source type="property" property="custInfo"/>
    <target type="body"/>
</enrich>

Is there a means to coerce the enrich mediator to treat the property ("custInfo") as an XML fragment rather than as straight text? I'm assuming that this is why the XML is getting escaped as the mediator believes it is setting the content of a node rather than specifying an XML fragment.

1 Answers1

0

How you defined property ? Can you try after adding

type="OM"

to the property definition and try again?

Shelan Perera
  • 1,753
  • 1
  • 11
  • 10
  • I had the property set to type="OM" but that was in the child property of the pojoCommand and it appears to NOT support the type attribute. However, your comment got me thinking and I then injected another stand-alone property mediator to take the results from the pojoCommand and assign that to a type="OM" messageContext property and then use that in the enrich mediator and voila! So thanks for getting me thinking about the type="OM"! [snip] – user1771151 Oct 25 '12 at 13:36
  • 1
    As you lead me to discover, just need to use the standalone property mediator so that the type="OM" gets applied. – user1771151 Oct 25 '12 at 13:39