Variables operation

16 views
Skip to first unread message

Подугоров Дмитрий

unread,
Feb 25, 2016, 2:58:10 PM2/25/16
to membrane-monitor
Hello,

Trying to implement API proxy using membrane face the next issue:

I need to return in response some parameters from request. For example:

Original request:
<request>
  <param1>1</param1>
  <param2>2</param2>
</request>

Transformed:
<request>
  <1>1</1>
  <2>2</2>
</request>

Response:
<response>
  <3>3</3>
</response>

Transformed
<response>
  <param3>3</param3>
  <param2>2</param2>
</response>


Is there any opportunity to store variables from request and return them in response?

Thanks.

Thomas Bayer

unread,
Feb 25, 2016, 3:12:26 PM2/25/16
to membrane...@googlegroups.com
Hi,


Am 25.02.16 um 17:05 schrieb Подугоров Дмитрий:



Is there any opportunity to store variables from request and return them in response?
Yes. Store the variables inside the exchange object in the request flow using setProperty and take it out in the response flow. See:

<serviceProxy port="2000">
    <request>
        <groovy>
            exc.setProperty("key", "My Message")
        </groovy>                    
    </request> <response>  <groovy>
            print exc.getProperty("key")
       </groovy> </response>
    <target host="www.predic8.de" />     
</serviceProxy>      

Cheers,
Thomas




Thanks.
--
You received this message because you are subscribed to the Google Groups "membrane-monitor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to membrane-monit...@googlegroups.com.
To post to this group, send email to membrane...@googlegroups.com.
Visit this group at https://groups.google.com/group/membrane-monitor.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages