synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Asankha C. Perera" <>
Subject Re: Clone mediator
Date Wed, 21 Nov 2007 06:12:36 GMT
I committed a simple Callout mediator last night to the Synapse trunk.
For those of you who may want to check it out, I have uploaded a
SNAPSHOT build here

The Syntax is as follows:
 <callout serviceURL="string" [action="string"]>
      <source xpath="expression" | key="string">
      <target xpath="expression" | key="string"/>

Basically the callout mediator would make a blocking call to the
provided service using the URL and the optional action. This request
message could be a fragment from the current message if the source
attribute specifies an XPath expression to get the necessary payload
(Note: only the payload which will go within the SOAP body should be
specified here). Alternatively you could refer to some XML fragment you
have previously stored into the current message context via a property
key, or even a local or remote registry entry that holds an XML request
payload. If a target XPath expression is specified, that node from the
current message is replaced with the reply received after the callout.
If a key is specified, the response is stored on the current message
context as an XML fragment.

Note that I also made a slight enhancement to the XSLT mediator to be
able to store the result of a transformation (i.e. the XML fragment) as
a message context property. i.e. the "target" attribute as shown below.

<xslt key="property-key" [source="xpath"] [target="string"]>
   <property name="string" (value="literal" | expression="xpath")/>

Your thoughts and suggestions are welcome. However, note that this
offers only the ability to make simple callouts and thus would have


Asankha C. Perera wrote:
> Hi Guys
> This is your lucky day! I would be committing a simple Callout mediator
> to the Synapse trunk later today.. and this would allow you to do this
> rather easily.. I will try to make a nightly build and upload along with
> it..
> thanks
> asankha
> Alexander Faust wrote:
>> Hi,
>> you could maybe NOT clone the message with the clone mediator and just
>> create a mediator that will copy the MessageContext, request the other
>> WS, wait for an answer, send the answer to the endpoint and then
>> continue processing the original MessageContext like nothing happened?
>> This way the processing of the original Message would be delayed until
>> you could process the copy.
>> Hope this helps... sorry for the bad english.
>> Alexander Faust
>> Am 20.11.2007 um 11:44 schrieb Laurent CHARTIER:
>>> Hi all,
>>> in the sequence I'm writing, when I receive a message, I have to create
>>> another message to request a specific WS before I can send the received
>>> message to the endpoint.
>>> Is there a way that the cloned messages created by the clone mediator
>>> are
>>> not processed parallelly ?
>>> Thanks,
>>> Laurent CHARTIER
>>> ME Socles Techniques - Pôle Mise en Œuvre
>>> AGORA Montauban - Tél. :
>>> P Avant d'imprimer, pensez à l'Environnement
>>> Ce message est protégé par les règles relatives au secret des
>>> correspondances. Il est donc établi à destination exclusive de son
>>> destinataire. Celui-ci peut donc contenir des informations
>>> confidentielles. La divulgation de ces informations est à ce titre
>>> rigoureusement interdite. Si vous avez reçu ce message par erreur,
>>> merci de le renvoyer à l'expéditeur dont l'adresse e-mail figure
>>> ci-dessus et de détruire le message ainsi que toute pièce jointe.
>>> This message is protected by the secrecy of correspondence rules.
>>> Therefore, this message is intended solely for the attention of the
>>> addressee. This message may contain privileged or confidential
>>> information, as such the disclosure of these informations is strictly
>>> forbidden. If, by mistake, you have received this message, please
>>> return this message to the addressser whose e-mail address is written
>>> above and destroy this message and all files attached.
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> For additional commands, e-mail:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View raw message