synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sadeep Jayasumana <gayansad...@gmail.com>
Subject Re: Payload factory mediator to support creating full SOAPEnvelope
Date Wed, 16 Jan 2013 12:18:14 GMT
Hi,

When Payload-factory mediator was initially developed, the main objective
was to provide an easy and intuitive way to create a new payload from a
well defined template. It turns out to be a very common use case, specially
when integrating data services. Although the same functionality can be
gained from Enrich mediator with somewhat less obvious configuration, we
thought adding a new mediator is justified given how common the use case is.

Using Payload-factory mediator with 'target' attribute to modify a part of
the envelop makes less sense to me, we might as well use Enrich mediator
for such cases.

Thanks,
Sadeep

On Wed, Jan 16, 2013 at 10:42 PM, Senaka Fernando <senakafdo@gmail.com>wrote:

> Hi Miyuru,
>
> Just a question. can't we make the target an XPath expression? That way
> you can modify any part of the envelope AFAIU.
>
> WDYT?
>
> Thanks,
> Senaka.
>
>
> On Wed, Jan 16, 2013 at 2:49 PM, Miyuru Wanninayaka <miyurudw@gmail.com>wrote:
>
>> Hi all,
>>
>> Currently Payload factory mediator only supports generating content of
>> SOAP body and there is no way to create full SOAP message with SOAP headers
>> using payload factory mediator.
>>
>> How about implementing this?
>>
>> option 1. We can add a attribute to payload factory mediator to define
>> whether result need to set as SOAP enveloper / SOAP body
>>
>>          <payloadFactory target="envelope | body>
>>             <format>
>>                <soapenv:Envelope xmlns:soapenv="
>> http://www.w3.org/2003/05/soap-envelope">
>>                   <soapenv:Header>
>>                      <foo>
>>                         <bar>?</bar>
>>                      </foo>
>>                   </soapenv:Header>
>>                   <soapenv:Body>
>>                       <request>?</request>
>>                   </soapenv:Body>
>>                </soapenv:Envelope>
>>             </format>
>>          </payloadFactory>
>>
>> option 2. In payloadFactory, check for structure of message. If it is a
>> SOAP envelope, set as mc.setEnvelope(), else set as content of existing
>> message's body.
>>
>> I prefer option#2 because, because no need to add 1 more attribute to
>> payloadFactory config.
>>
>> WDYT?
>>
>> --
>> Miyuru Wanninayaka
>> Senior Software Engineer - WSO2 Inc <http://wso2.com/>.
>
>
>


-- 

Sadeep Jayasumana

**

Email: gayansadeep@gmail.com****

Mobile: +61 4 1468 8521

Mime
View raw message