WSO2 as RPC server with RabbitMQ - rabbitmq

I have a following task:
WSO2 listening a RabbitMQ (amqp) queue for incoming message, call some DB procedure and reply back to specified in incoming message queue (reply_to property) with specified Correlation Id (correlation_id property).
I used dynamic message routing with Default endpoint (named RabbitMQ_DefEP) and CorrelationId
I spend some time to gathering information to make this work. Here is working example
It may be useful for others
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="RabbitMQRPCTest01" startOnLoad="true" transports="rabbitmq" xmlns="http://ws.apache.org/ns/synapse">
<target>
<inSequence>
<log description="" level="custom">
<property name="*****Rabbit MQ Start" value="********************************* headers"/>
</log>
<log level="headers"/>
<log description="" level="custom">
<property name="*****Rabbit MQ" value="********************************* full"/>
</log>
<log level="full"/>
<log description="CorrId" level="custom">
<property expression="$header" name="***Header="/>
<property expression="$body" name="***Body="/>
</log>
<property description="Get Correlation Id" expression="get-property('transport', 'rabbitmq.message.correlation.id')" name="corrid" scope="default" type="STRING"/>
<property description="Get Reply To" expression="get-property('transport', 'RABBITMQ_REPLY_TO')" name="replto" scope="default" type="STRING"/>
<log level="custom">
<property expression="get-property('corrid')" name="***CORRELATION ID="/>
<property expression="get-property('replto')" name="***REPLY_TO="/>
</log>
<payloadFactory description="Set payload for procedure call" media-type="xml">
<format>
<p:CallPing xmlns:p="http://ws.wso2.org/dataservice">
<p:req>$1</p:req>
</p:CallPing>
</format>
<args>
<arg evaluator="xml" expression="$body//ns:text" xmlns:ns="http://ws.apache.org/commons/ns/payload"/>
</args>
</payloadFactory>
<property description="HTTP_METHOD" name="HTTP_METHOD POST" scope="axis2" type="STRING" value="POST"/>
<property description="SOAPAction" name="SOAPAction" scope="transport" type="STRING" value=""/>
<property description="messageType" name="messageType" scope="axis2" type="STRING" value="application/xml"/>
<log level="custom">
<property expression="$body" name="*****Procedure params"/>
</log>
<send>
<endpoint key="DMSB_CFTEP"/>
</send>
</inSequence>
<outSequence>
<log description="" level="custom">
<property name="*****Rabbit MQ Reply started" value="*********************************"/>
</log>
<log description="Full Log" level="full"/>
<header description="Build URI for AMQP" expression="fn:concat('rabbitmq:/AMQPProducerSample?rabbitmq.server.host.name=rabbitmq.ru&rabbitmq.server.port=5672&rabbitmq.server.user.name=monitor&rabbitmq.server.password=12345&rabbitmq.connection.factory=RabbitMQConnectionFactory&rabbitmq.exchange.name=&rabbitmq.queue.routing.key=', get-property('replto'))" name="To" scope="default"/>
<log description="" level="custom">
<property name="*****Rabbit MQ Reply END" value="*********************************"/>
</log>
<property description="Set Correlation Id" expression="get-property('corrid')" name="rabbitmq.message.correlation.id" scope="axis2" type="STRING"/>
<call>
<endpoint key="RabbitMQ_DefEP"/>
</call>
</outSequence>
<faultSequence>
<log level="custom">
<property expression="$body" name="****FAULT***************"/>
</log>
<log description="Log Props" level="full">
<property name="text" value="An unexpected error occured. Executing fault sequence"/>
<property expression="get-property('ERROR_MESSAGE')" name="ERROR_MESSAGE"/>
<property expression="get-property('ERROR_DETAIL')" name="detail"/>
<property expression="get-property('ERROR_EXCEPTION')" name="exception"/>
<property expression="get-property('ERROR_CODE')" name="ERROR_CODE"/>
</log>
</faultSequence>
</target>
<parameter name="rabbitmq.queue.name">esb</parameter>
<parameter name="rabbitmq.connection.factory">AMQPConnectionFactory</parameter>
</proxy>

Related

OnComplete in Aggregate sequence not triggered after the Iteration sequence

I'm building a microservice where I have a main sequence that first reads a json file and then goes into iteration sequence that is connected to an aggregator sequence with an ID. Here is the order from the main sequence:
<property expression="json-eval($)" name="ORIGINAL_PAYLOAD" scope="default" type="STRING"/>
<sequence key="data-iterate-seq"/>
<property name="aggregatedResponses" scope="default">
<batch_response/>
</property>
<sequence key="data-aggregate-seq"/>
The problem I'm facing is that once it goes into iterate it first triggers the code in aggregate that is outside of OnComplete, then it goes back and does the iterations and never goes to the OnComplete neither it goes back to the main sequence. I managed to make it continue with the main sequence using continueParent=true but this way it never goes into OnComplete of the aggregation sequence. I have also tried switching the onComplete expression to $body/*[1] and //jsonObject but it didn't work Edit: neither did the <send/> and <loopback/> operators.
Here is my iterator
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="data-iterate-seq" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<iterate attachPath="json-eval($)" expression="json-eval($.records)" id="requestIterator" preservePayload="true">
<target>
<sequence>
<payloadFactory media-type="json">
<format>$1</format>
<args>
<arg evaluator="json" expression="$"/>
</args>
</payloadFactory>
<property name="messageType" scope="axis2" type="STRING" value="application/json"/>
<log level="custom" separator="
">
<property expression="json-eval($)" name="BODY_INSIDE_ITERATE"/>
</log>
<!-- Prepare Payload -->
<property expression="json-eval($.recordId)" name="recordId" scope="default" type="STRING"/>
<property name="entitySetName" scope="default" type="STRING" value="accounts"/>
<property expression="concat(get-property('msdynamics365.resource'),'/api/data/',get-property('msdynamics365.api.version'),'/')" name="patch-url" scope="axis2" type="STRING"/>
<payloadFactory media-type="json">
<format>{"batch_response": "{ "relativeUrlTemplate": "{{apiUrl}}{{entitySetName}}{{entityRecordId}}",
"method": "PATCH",
"entitySetName": "$1",
"entityRecordId": "$2",
"data": {
"name":"$3",
"email":"$4"
}
}}
</format>
<args>
<arg evaluator="xml" expression="$ctx:entitySetName"/>
<arg evaluator="xml" expression="$ctx:recordId"/>
<arg evaluator="json" expression="$.data.name"/>
<arg evaluator="json" expression="$.data.emailaddress1"/>
</args>
</payloadFactory>
<property name="messageType" scope="axis2" type="STRING" value="application/json"/>
<log level="full"/>
<log level="custom" separator="
">
<property name="Results" value="Number of iterations"/>
</log>
</sequence>
</target>
</iterate>
</sequence>
and my aggregator:
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="data-aggregate-seq" onError="data-fault-seq" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<aggregate id="requestIterator">
<completeCondition>
<messageCount max="-1" min="-1"/>
</completeCondition>
<onComplete aggregateElementType="root" enclosingElementProperty="aggregatedResponses" expression="json-eval($)" xmlns:ns="http://org.apache.synapse/xsd">
<property expression="json-eval($)" name="aggregatedResponses" scope="default" type="STRING"/>
<log level="full">
<property expression="json-eval($)" name="OUT_SEQUENCE_AGGREGATED_RESPONSE"/>
</log>
<log level="full">
<property expression="get-property('aggregatedResponses')" name="Responses"/>
</log>
</onComplete>
</aggregate>
<log level="custom">
<property expression="json-eval($)" name="FINAL_PAYLOAD"/>
<property expression="get-property('aggregatedResponses')" name="aggregated_Response"/>
</log>
</sequence>
Any suggestions on what I'm doing wrong or anything that might help would be really appreciated!
Thank you in advance!!
According to the documentation, you need to use a call or send mediator inside the Iterate mediator to continue the message flow.
In Iterate you need to send the split messages to an endpoint to
continue the message flow.
For me, it seems you are only transforming the message payload. Hence you can use Foreach mediator to do that without Iterate mediator.

salesforcerest.update not working in WSO2 EI 6.1.1

I am doing Salesforce update operation using Salesforce Rest connector in wso2 ei. problem here is record not updated, it shows below exception after forming request payload.
Exception:
|**TID: [-1234] [] [2019-12-06 05:03:05,191] ERROR {org.apache.synapse.commons.json.JsonUtil} - #getNewJsonPayload. Could not save JSON payload. Invalid input stream found. MessageID: urn:uuid:33275d28-c55d-4a9e-bbcd-17d60cc38d1e {org.apache.synapse.commons.json.JsonUtil}
TID: [-1234] [] [2019-12-06 05:03:05,192] ERROR {org.apache.synapse.mediators.transform.PayloadFactoryMediator} - Error creating JSON Payload from source Lead {org.apache.synapse.mediators.transform.PayloadFactoryMediator}**
Code Snippet:
<api xmlns="http://ws.apache.org/ns/synapse" name="TestImageAPI" context="/imageapi">
<resource methods="GET" protocol="http https">
<inSequence>
<log level="custom" separator=",**, " description="FaultSequence">
<property name="=====TestImageAPI=====" value="called===="/>
</log>
<property name="ValuationId" value="00Q5500000AGHikEAH" scope="default" type="STRING"/>
<property name="First_Image_Name__c" value="cbimage" scope="default" type="STRING"/>
<property name="ObjectName" value="Lead" scope="default" type="STRING"/>
<payloadFactory media-type="json" description="Form Response Payload">
<format>{"Lead_Type__c":"$1"}</format>
<args>
<arg value="Phone"/>
</args>
</payloadFactory>
<property name="fieldAndValue" expression="json-eval($.)" scope="default" type="STRING"/>
<log level="custom">
<property name="===FirstImagepayload=====" expression="$ctx:fieldAndValue"/>
</log>
<sequence key="QRSag_VBSalesforceInitializer" description="Load Configurations"/>
<salesforcerest.init>
<accessToken>{$ctx:accessToken}</accessToken>
<apiVersion>{$ctx:apiVersion}</apiVersion>
<hostName>{$ctx:hostName}</hostName>
<refreshToken>{$ctx:refreshToken}</refreshToken>
<clientSecret>{$ctx:clientSecret}</clientSecret>
<clientId>{$ctx:clientId}</clientId>
<apiUrl>{$ctx:apiUrl}</apiUrl>
<registryPath>{$ctx:registryPath}</registryPath>
<intervalTime>{$ctx:intervalTime}</intervalTime>
</salesforcerest.init>
<property name="SalesforceAccessToken" expression="json-eval($.access_token)" scope="default" type="STRING"/>
<log level="full"/>
<property xmlns:ns="http://org.apache.synapse/xsd" name="Authorization" expression="fn:concat('Bearer ', get-property('SalesforceAccessToken'))" scope="transport" type="STRING" description="Authorization"/>
<salesforcerest.update>
<sObjectName>{$ctx:ObjectName}</sObjectName>
<Id>{$ctx:ValuationId}</Id>
<fieldAndValue>{$ctx:fieldAndValue}</fieldAndValue>
</salesforcerest.update>
</inSequence>
<outSequence/>
<faultSequence/>
</resource>
</api>
Note: Added Salesforce Rest connector in both server as well as ESB Project
Could anyone please give me a solution??
I have achieved the above mentioned use case. FYI,
<property description="Authorization" expression="fn:concat('Bearer ', get-property('SalesforceAccessToken'))" name="Authorization" scope="transport" type="STRING" xmlns:ns="http://org.apache.synapse/xsd"/>
<payloadFactory description="Form Response Payload" media-type="json">
<format>{"First_Image_Name__c":"$1"}</format>
<args>
<arg evaluator="xml" expression="$ctx:First_Image_Name__c"/>
</args>
</payloadFactory>
<log level="custom">
<property expression="json-eval($.)" name="===FirstImagepayload====="/>
</log>
<property expression="json-eval($.)" name="fieldAndValue" scope="default" type="STRING"/>
<property name="messageType" scope="axis2" type="STRING" value="application/json"/>
<property name="OUT_ONLY" scope="default" type="STRING" value="false"/>
<property expression="fn:concat($ctx:instance_url,'/services/data/v47.0/sobjects/Product2/',$ctx:StockID)" name="uri.var.ImageUpload" scope="default" type="STRING"/>
<property description="Authorization" expression="fn:concat('Bearer ', get-property('SalesforceAccessToken'))" name="Authorization" scope="transport" type="STRING" xmlns:ns="http://org.apache.synapse/xsd"/>
<log level="custom">
<property expression="$ctx:uri.var.ImageUpload" name="===SalesforceLink========="/>
</log>
<call description="ImageuploadEndpoint">
<endpoint>
<http method="patch" uri-template="{uri.var.ImageUpload}"/>
</endpoint>
</call>
<log level="full" separator="=== First Image Name Update Response ==="/>

Sending Content-Type application/x-www-form-urlencoded WSO2 ESB

I have been working in a service chaining that answers me with a Bearer Token using in WSO2 EMM.
I made a proxy in ESB and then I passed to a new sequence that makes the next call but this one receives a Content-Type application/x-www-form-urlencoded. I have been looking for some help so that I can find anything interesting.
This is my proxy
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="TokenService" startOnLoad="true" statistics="enable"
trace="enable" transports="http https" xmlns="http://ws.apache.org/ns/synapse">
<target>
<inSequence>
<!--Aggregate incoming responses -->
<log level="full">
<property name="sequence" value="Paso 1 - request for client register"/>
</log>
<property description="Content-Type" name="ContentType"
scope="default" type="STRING" value="application/json"/>
<header name="Accept" scope="transport" value="application/json"/>
<payloadFactory description="Payload" media-type="json">
<format>{
"owner": "admin",
"clientName": "admin_emm",
"grantType":
"refresh_token password client_credentials",
"tokenScope": "prod"
}</format>
<args/>
</payloadFactory>
<send receive="Mensaje"/>
</inSequence>
<outSequence/>
<faultSequence/>
</target>
</proxy>
This is my sequence that gets the response from the other service in my proxy
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="Mensaje" trace="enable" xmlns="http://ws.apache.org/ns/synapse">
<log level="custom">
<property expression="json-eval($.client_secret)"
name="client_secret" xmlns:ns="http://org.apache.synapse/xsd"/>
</log>
<log level="custom">
<property expression="json-eval($.client_id)" name="client_id" xmlns:ns="http://org.apache.synapse/xsd"/>
</log>
<log level="custom">
<property
expression="fn:concat('Basic ', base64Encode('client_id:client_secret'))"
name="Authorization" xmlns:ns="http://org.apache.synapse/xsd"/>
</log>
<property name="grant_type" value="password"/>
<property name="username" value="admin"/>
<property name="password" value="admin"/>
<property name="scope" value="default"/>
<header name="Accept" scope="transport" value="application/json"/>
<payloadFactory media-type="xml">
<format>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<root xmlns="">
<grant_type>$1</grant_type>
<username>$2</username>
<password>$3</password>
<scope>$4</scope>
</root>
</soapenv:Body>
</soapenv:Envelope>
</format>
<args>
<arg evaluator="xml" expression="$ctx:grant_type" xmlns:ns="http://org.apache.synapse/xsd"/>
<arg evaluator="xml" expression="$ctx:username" xmlns:ns="http://org.apache.synapse/xsd"/>
<arg evaluator="xml" expression="$ctx:password" xmlns:ns="http://org.apache.synapse/xsd"/>
<arg evaluator="xml" expression="$ctx:scope" xmlns:ns="http://org.apache.synapse/xsd"/>
</args>
</payloadFactory>
<property name="ContentType" value="application/x-www-form-urlencoded"/>
<property name="DISABLE_CHUNKING" scope="axis2" type="STRING" value="true"/>
<call>
<endpoint name="Token">
<http method="POST" uri-template="https://localhost:9443/oauth2/token"/>
</endpoint>
</call>
<respond/>
</sequence>
Then when i run it i have an error of HTTP/1.1 415 Unsupported Media Type
Please, help
I got it this is the answer
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="Mensaje" trace="enable" xmlns="http://ws.apache.org/ns/synapse">
<property expression="json-eval($.client_secret)"
name="client_secret" xmlns:ns="http://org.apache.synapse/xsd"/>
<property expression="json-eval($.client_id)" name="client_id" xmlns:ns="http://org.apache.synapse/xsd"/>
<property
expression="fn:concat(get-property('client_id'),':',get-property('client_secret'))"
name="Concatenados" xmlns:ns="http://org.apache.synapse/xsd"/>
<property expression="base64Encode(get-property('Concatenados'))"
name="Codificados" xmlns:ns="http://org.apache.synapse/xsd"/>
<property
expression="fn:concat('Basic ', get-property('Codificados'))"
name="Autorizacion" xmlns:ns="http://org.apache.synapse/xsd"/>
<property name="grant_type" value="password"/>
<property name="username" value="admin"/>
<property name="password" value="admin"/>
<property name="scope" value="default"/>
<payloadFactory media-type="xml">
<format>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<root xmlns="">
<grant_type>$1</grant_type>
<username>$2</username>
<password>$3</password>
<scope>$4</scope>
</root>
</soapenv:Body>
</soapenv:Envelope>
</format>
<args>
<arg evaluator="xml" expression="$ctx:grant_type" xmlns:ns="http://org.apache.synapse/xsd"/>
<arg evaluator="xml" expression="$ctx:username" xmlns:ns="http://org.apache.synapse/xsd"/>
<arg evaluator="xml" expression="$ctx:password" xmlns:ns="http://org.apache.synapse/xsd"/>
<arg evaluator="xml" expression="$ctx:scope" xmlns:ns="http://org.apache.synapse/xsd"/>
</args>
</payloadFactory>
<header name="Content-Type" scope="transport" value="application/x-www-form-urlencoded"/>
<header expression="get-property('Autorizacion')"
name="Authorization" scope="transport" xmlns:ns="http://org.apache.synapse/xsd"/>
<property name="messageType" scope="axis2" type="STRING" value="application/x-www-form-urlencoded"/>
<property name="DISABLE_CHUNKING" scope="axis2" type="STRING" value="true"/>
<call>
<endpoint name="Token">
<http method="POST" uri-template="https://localhost:9443/oauth2/token"/>
</endpoint>
</call>
<respond/>
</sequence>
I had the same error. This is my solution, similar to previous but in Json:
<property name="scope" scope="default" type="STRING" value="myScope"/>
<payloadFactory media-type="json">
<format>{"grant_type":"password","username":"admin","password":"admin","scope":"$1"}</format>
<args>
<arg evaluator="xml" expression="get-property('scope')"/>
</args>
</payloadFactory>
<!-- authorization header with consumer-key:consumer-secret in Base64 -->
<header name="Authorization" scope="transport" value="Basic RUVyY0VRejFfU..."/>
<header name="Content-Type" scope="transport" value="application/x-www-form-urlencoded"/>
<property name="messageType" scope="axis2" type="STRING" value="application/x-www-form-urlencoded"/>
<call blocking="true">
<endpoint key="GetToken"/>
</call>

WSO2 ESB API configuration to send same post request to different Rest services

I need to send a post request to different REST services, below is the complete requirement.
I am using REST API configuration of WSO2 ESB
First I need to post a request to one service and based on successful posting then need to post this same to another service. But I need to obtain the response from first service and send it to fronend. But I do not need to obtain the response from second service.
Please find the API configuration below and help me.
<api xmlns="http://ws.apache.org/ns/synapse" name="test" context="/test">
<resource methods="POST DELETE PUT GET">
<inSequence>
<log level="custom">
<property name="Message Flow" value="Roovershof Plant Search API - IN"></property>
<property name="HTTP_METHOD IS###########" expression="$axis2:HTTP_METHOD"></property>
<property name="ip address" expression="get-property('axis2','REMOTE_ADDR')"></property>
<property name="Authorization" expression="get-property('transport','Authorization')"></property>
</log>
<property name="TIME_IN" expression="get-property('SYSTEM_TIME')" scope="default" type="LONG"></property>
<send>
<endpoint>
<address uri="service1"></address>
</endpoint>
</send>
<log level="custom">
<property name="Request Method :" expression="get-property('axis2', 'HTTP_METHOD')"></property>
</log>
<filter source="get-property('axis2', 'HTTP_SC')" regex="201">
<then>
<clone continueParent="true">
<target>
<property name="REST_URL_POSTFIX" scope="axis2" action="remove"></property>
<property name="messageType" value="application/json" scope="axis2"></property>
<property name="HTTP_METHOD" value="POST" scope="axis2"></property>
<property name="FORCE_SC_ACCEPTED" value="true" scope="axis2" type="STRING"></property>
<property name="OUT_ONLY" value="true" scope="default" type="STRING"></property>
<send>
<endpoint>
<address uri="servicr2"></address>
</endpoint>
</send>
</target>
<target sequence="magento" />
</clone>
Your synapse configuration does not match your statement. You have to preserve the original message using enrich mediator and then make use the call mediator for your first endpoint invocation.
Then based on the results, you send the response back to your client and do the send call by reloading the message from the preservation.
<api xmlns="http://ws.apache.org/ns/synapse" name="TestApi" context="/TestContext">
<resource methods="POST GET">
<inSequence>
<log level="custom">
<property name="Message Flow" value="Roovershof Plant Search API - IN"></property>
<property name="HTTP_METHOD IS###########" expression="$axis2:HTTP_METHOD"></property>
<property name="ip address" expression="get-property('axis2','REMOTE_ADDR')"></property>
<property name="Authorization" expression="get-property('transport','Authorization')"></property>
</log>
<property name="TIME_IN" expression="get-property('SYSTEM_TIME')" scope="default" type="LONG"></property>
<enrich>
<source type="body" clone="true"></source>
<target type="property" property="INIT_MSG_PAYLOAD"></target>
</enrich>
<call>
<endpoint>
<address uri="service1"></address>
</endpoint>
</call>
<filter source="get-property('axis2', 'HTTP_SC')" regex="201">
<then>
<clone continueParent="true">
<target>
<sequence>
<respond></respond>
</sequence>
</target>
<target>
<sequence>
<enrich>
<source type="property" clone="true" property="INIT_MSG_PAYLOAD"></source>
<target type="body"></target>
</enrich>
<property name="REST_URL_POSTFIX" scope="axis2" action="remove"></property>
<property name="messageType" value="application/json" scope="axis2"></property>
<property name="HTTP_METHOD" value="POST" scope="axis2"></property>
<property name="FORCE_SC_ACCEPTED" value="true" scope="axis2" type="STRING"></property>
<property name="OUT_ONLY" value="true" scope="default" type="STRING"></property>
<send>
<endpoint>
<address uri="servicr2"></address>
</endpoint>
</send>
</sequence>
</target>
</clone>
</then>
<else>
<respond/>
</else>
</filter>
</inSequence>
</resource>
</api>

How to add Authentication to my proxy service(get) in wso2 esb(4.6.0)please any one help me the procedure,i cant find much more on this?

These are the below proxy service and sequences...if i am running with empty curl command data is showing for get service,so that i want to authenticate that data
<proxy xmlns="http://ws.apache.org/ns/synapse" name="Get_meter_Mobile" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
<target>
<inSequence onError="fault">
<property name="CONTENT_TYPE" value="application/json" scope="axis2" type="STRING"/>
<property name="HTTP_METHOD" value="POST" scope="axis2" type="STRING"/>
<payloadFactory>
<format>
<mmeter xmlns=""/>
</format>
</payloadFactory>
<send receive="Get_meter_Mobile_seq">
<endpoint>
<address uri="http://localhost:9764/services/meter_DataService/" format="soap11"/>
</endpoint>
</send>
<property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')" scope="axis2" type="STRING"/>
<property name="ERROR_CODE" expression="get-property('ERROR_CODE')" scope="axis2" type="STRING"/>
<log level="full"/>
<property name="FORCE_ERROR_ON_SOAP_FAULT" value="true" scope="default" type="STRING"/>
</inSequence>
<outSequence>
<property name="CONTENT_TYPE" value="application/json" scope="axis2"/>
<log level="full"/>
<send/>
</outSequence>
</target>
<description></description>
</proxy>
You can achice this by applying POX security to your Proxy service. The blog post [1] will show you the steps to follow.
[1]. http://evanthika.blogspot.com/2012/12/pox-security-with-wso2-esb-proxy.html
Thank You,
Dharshana.