When using property mediator pattern i am getting internal server error
<?xml version="1.0" encoding="UTF-8"?>
<sequence xmlns="http://ws.apache.org/ns/synapse" name="regex">
<log level="custom">
<property name="log" value="******************************"/>
</log>
<property name="regex" expression="$url:regex" scope="default"
type="string" pattern="(.|\s)*\S(.|\s)*" group="2"/>
<property name="service_ep"
value="http://www.mocky.io/v2/5d0086223200007700f9d561" />
<header name="To" expression="get-property('service_ep')" />
<log level="full"/>
</sequence>
Response what i am getting :
<am:fault xmlns:am="http://wso2.org/apimanager">
<am:code>0</am:code>
<am:type>Status report</am:type>
<am:message>Runtime Error</am:message>
<am:description>Unknown type : string for the property mediator or the
property value cannot be converted into the specified type.
</am:description>
</am:fault>
The type should be in block letters.
<property name="regex" expression="$url:regex" scope="default"
type="STRING" pattern="(.|\s)*\S(.|\s)*" group="2"/>
Please refer to this documentation. https://docs.wso2.com/display/EI650/Property+Mediator#PropertyMediator-ConfigurationConfigs
Related
I have been struggling with WSO2 Throttle mediation and have setup using the WSO2 documentation. Still, I am unable to achieve the desired objective of getting the effect of the policy.
Although the code is there, but the policy says something like this:
IF Request coming from IP={{MY_IP}} and request count <= 10
THEN Do call the endpoint / sequence (AcceptSequence) -> In this, the endpoint will be called
ELSE IF request count > 10, the requests will be logged in the database.
I have tested the endpoint for accept sequence AND the EI Dataservice for rejectSequence both individually and are working fine. I can even see the request coming in EI wso2carbon logs but there is no sign of throttle mediator calling and is returning "202 Accepted"
<?xml version="1.0" encoding="UTF-8"?>
<api context="/my_api" name="MY_API" version="1.0.0" version-type="context" xmlns="http://ws.apache.org/ns/synapse">
<resource methods="POST">
<inSequence>
<log level="custom">
<property expression="json-eval($)" name="Incoming Payload"/>
</log>
<property description="Client_Name" expression="$trp:Client_Name" name="Client_Name" scope="default" type="STRING"/>
<property description="Client_DOB" expression="$trp:Client_DOB" name="Client_DOB" scope="default" type="STRING"/>
<property description="Client_ID_Type" expression="$trp:Client_ID_Type" name="Client_ID_Type" scope="default" type="STRING"/>
<property description="Client_ID_No" expression="$trp:Client_ID_No" name="Client_ID_No" scope="default" type="STRING"/>
<property description="Client_Gender" expression="$trp:Client_Gender" name="Client_Gender" scope="default" type="STRING"/>
<property description="Client_Nationality" expression="$trp:Client_Nationality" name="Client_Nationality" scope="default" type="STRING"/>
<property description="Source_System" expression="$trp:Source_System" name="Source_System" scope="default" type="STRING"/>
<property description="Transaction_Type" expression="$trp:Transaction_Type" name="Transaction_Type" scope="default" type="STRING"/>
<property description="Transaction_Ref_No" expression="$trp:Transaction_Ref_No" name="Transaction_Ref_No" scope="default" type="STRING"/>
<property description="Transaction_Ref_No_2" expression="$trp:Transaction_Ref_No_2" name="Transaction_Ref_No_2" scope="default" type="STRING"/>
<property description="Transaction_Date" expression="$trp:Transaction_Date" name="Transaction_Date" scope="default" type="STRING"/>
</inSequence>
<outSequence>
<throttle id="myThrottle" onAccept="acceptSequence" onReject="rejectSequence">
<policy>
<wsp:Policy wsu:id="WSO2MediatorThrottlingPolicy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<throttle:MediatorThrottleAssertion xmlns:throttle="http://www.wso2.org/products/wso2commons/throttle">
<throttle:MaximumConcurrentAccess>0</throttle:MaximumConcurrentAccess>
<wsp:Policy>
<throttle:ID throttle:type="IP">{{Required_IP}}</throttle:ID>
<wsp:Policy>
<throttle:Control>
<wsp:Policy>
<throttle:MaximumCount>10</throttle:MaximumCount>
<throttle:UnitTime>60000</throttle:UnitTime>
<throttle:ProhibitTimePeriod>60000</throttle:ProhibitTimePeriod>
</wsp:Policy>
</throttle:Control>
</wsp:Policy>
</wsp:Policy>
</throttle:MediatorThrottleAssertion>
</wsp:Policy>
</policy>
</throttle>
<log/>
</outSequence>
<faultSequence/>
</resource>
</api>
The throttle mediator is not working as expected not because of an issue with the throttle mediator but due to the way that you have implemented this.
In the inSequence, you have only defined log and some property mediators. With this implementation, the outSequence will not be invoked. Since you have implemented the throttle mediator in the outSequence and since this is not executed you are able to invoke the API without the requests are getting throttled. You can refer to some of the documentation to clarify regarding EI message mediation (ex: [1])
The messages will be passed to the outSequnce from the inSequence only in the following two scenarios.
If you have used loopback mediator [2]
If you have used a send mediator to invoke a backend. In this case, the response from the backend is sent to the outSequence.
Therefore to resolve this issue you have 2 options.
Add a loopback mediator at the end of the property mediators in the inSequence
Modify the mediation as follows to get the throttle mediator to the inSequence.
<?xml version="1.0" encoding="UTF-8"?>
<api xmlns="http://ws.apache.org/ns/synapse" context="/my_api" name="MY_API" version="1.0.0" version-type="context">
<resource methods="POST">
<inSequence>
<log level="custom">
<property expression="json-eval($)" name="Incoming Payload" />
</log>
<property description="Client_Name" expression="$trp:Client_Name" name="Client_Name" scope="default" type="STRING" />
<property description="Client_DOB" expression="$trp:Client_DOB" name="Client_DOB" scope="default" type="STRING" />
<property description="Client_ID_Type" expression="$trp:Client_ID_Type" name="Client_ID_Type" scope="default" type="STRING" />
<property description="Client_ID_No" expression="$trp:Client_ID_No" name="Client_ID_No" scope="default" type="STRING" />
<property description="Client_Gender" expression="$trp:Client_Gender" name="Client_Gender" scope="default" type="STRING" />
<property description="Client_Nationality" expression="$trp:Client_Nationality" name="Client_Nationality" scope="default" type="STRING" />
<property description="Source_System" expression="$trp:Source_System" name="Source_System" scope="default" type="STRING" />
<property description="Transaction_Type" expression="$trp:Transaction_Type" name="Transaction_Type" scope="default" type="STRING" />
<property description="Transaction_Ref_No" expression="$trp:Transaction_Ref_No" name="Transaction_Ref_No" scope="default" type="STRING" />
<property description="Transaction_Ref_No_2" expression="$trp:Transaction_Ref_No_2" name="Transaction_Ref_No_2" scope="default" type="STRING" />
<property description="Transaction_Date" expression="$trp:Transaction_Date" name="Transaction_Date" scope="default" type="STRING" />
<throttle id="myThrottle" onAccept="acceptSequence" onReject="rejectSequence">
<policy>
<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:id="WSO2MediatorThrottlingPolicy">
<throttle:MediatorThrottleAssertion xmlns:throttle="http://www.wso2.org/products/wso2commons/throttle">
<throttle:MaximumConcurrentAccess>0</throttle:MaximumConcurrentAccess>
<wsp:Policy>
<throttle:ID throttle:type="IP">{{Required_IP}}</throttle:ID>
<wsp:Policy>
<throttle:Control>
<wsp:Policy>
<throttle:MaximumCount>10</throttle:MaximumCount>
<throttle:UnitTime>60000</throttle:UnitTime>
<throttle:ProhibitTimePeriod>60000</throttle:ProhibitTimePeriod>
</wsp:Policy>
</throttle:Control>
</wsp:Policy>
</wsp:Policy>
</throttle:MediatorThrottleAssertion>
</wsp:Policy>
</policy>
</throttle>
</inSequence>
<outSequence>
<log />
<send />
</outSequence>
<faultSequence />
</resource>
</api>
[1]-https://docs.wso2.com/display/EI611/WSO2+Enterprise+Integrator+Best+Practices
[2]-https://ei.docs.wso2.com/en/7.2.0/micro-integrator/references/mediators/loopback-Mediator/
I have a problem to parse the callout response of a dss.
I have 2 servers
WSO2 ESB server (4.9.0)
WSO2 Application Server (5.3.0) with Data Service (4.3.4) feature installed
i make a payload
<payloadFactory description="Payload Processed" media-type="xml">
<format>
<p:archivoProcesado xmlns:p="MyDataService">
<xs:archivo xmlns:xs="MyDataService">$1</xs:archivo>
</p:archivoProcesado>
</format>
<args>
<arg evaluator="xml" expression="get-property('filename')" />
</args>
</payloadFactory>
After that i make a callout
<callout action="archivoProcesado" description="Callout ArchivoProcesado"
initAxis2ClientOptions="false"
serviceURL="http://192.168.0.33:9764/services/MyDataService?wsdl">
<source xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:s12="http://www.w3.org/2003/05/soap-envelope"
xpath="s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]" />
<target xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:s12="http://www.w3.org/2003/05/soap-envelope"
xpath="s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]" />
</callout>
To test the result i have:
<log level="custom">
<property expression="$body/*" name="RTA" />
</log>
And have:
LogMediator RTA = <ArchivosProcesados xmlns="MyDataService"><ArchivoProcesado><procesado>1</procesado></ArchivoProcesado></ArchivosProcesados>
but when i want to parse the response i cant
<log level="custom">
<property expression="//ArchivosProcesados/ArchivoProcesado/procesado/text()"
name="count" />
</log>
<log level="custom">
<property expression="//ArchivosProcesados" name="xxx" />
</log>
<log level="custom">
<property expression="//ArchivosProcesados/*" name="yyy" />
</log>
and the log is blank
INFO - LogMediator count =
INFO - LogMediator xxx =
INFO - LogMediator yyy =
How can i get the value? what am i doing wrong?
MyDSS
<query id="archivoProcesado" useConfig="MyDataService">
<sql>select count(1) as procesado from auto_procesados where archivo = ?</sql>
<param name="archivo" ordinal="1" paramType="SCALAR" sqlType="STRING" type="IN"/>
<result element="ArchivosProcesados" rowName="ArchivoProcesado">
<element column="procesado" name="procesado"/>
</result>
</query>
<operation name="archivoProcesado">
<call-query href="archivoProcesado">
<with-param name="archivo" query-param="archivo"/>
</call-query>
</operation>
In ESB 4.9.0 we have depricated the callout mediator. So could you please use call mediator [1] with [blocking="true"] instead. If it is not working please enable wirelogs as per [2] and check whether you are getting the response from the DSS endpoint properly. A sample call mediator configuration would be as follows.
<call blocking="true">
<endpoint>
<address format="soap12" uri="http://192.168.0.33:9764/services/MyDataService"/>
</endpoint>
</call>
Also when you get the data from DSS all the data falls under the following name space. http://ws.wso2.org/dataservice. You will have to define a namespace prefix to that namespace and use that in your xpath expressions. An example is given below.
<log level="custom">
<property xmlns:x="http://ws.wso2.org/dataservice" expression="//x:ArchivosProcesados/x:ArchivoProcesado/x:procesado/text()"
name="count" />
</log>
[1] https://docs.wso2.com/display/ESB490/Call+Mediator
[2] http://mytecheye.blogspot.com/2013/09/wso2-esb-all-about-wire-logs.html
Try adding the xmlns attribute to the property mediator.
<log level="custom">
<property xmlns="MyDataService" expression="//ArchivosProcesados/ArchivoProcesado/procesado/text()"
name="count" />
</log>
JP
First of all i change the callout by a blocking call.
After that i change the messageType to json
<property name="messageType" scope="axis2" type="STRING" value="application/json"/>
and then access through json-eval
<property expression="json-eval($.ArchivosProcesados.ArchivoProcesado.procesado)"
name="count" scope="default" type="STRING"/>
Finally i back the message type to xml:
<property name="messageType" scope="axis2" type="STRING" value="text/xml"/>
I am trying to implement a sequence template that calls a endpoint template leveraging the parameters.
My code is as follows:
SEQUENCE-
<sequence xmlns="http://ws.apache.org/ns/synapse" name="aFileWriteSequence" trace="disable">
<log level="custom">
<property name="sequence" value="aFileWriteSequence"></property>
</log>
<property xmlns:ns="http://org.apache.synapse/xsd" name="filename" expression="get-property('transport', 'FILE_NAME')" scope="default" type="STRING"></property>
<call-template target="FileWriteTemplate">
<with-param name="targetFileName" value="A_TITLE"></with-param>
<with-param name="addressUri" value="vfs:file:///var/process/ren/rrout"></with-param>
</call-template>
</sequence>
SEQUENCE TEMPLATE-
<template xmlns="http://ws.apache.org/ns/synapse" name="FileWriteTemplate">
<parameter name="targetFileName"></parameter>
<parameter name="addressUri"></parameter>
<sequence>
<log level="custom">
<property xmlns:ns2="http://org.apache.synapse/xsd" xmlns:ns="http://org.apache.synapse/xsd" name="TARGET_FILE_NAME" expression="$func:targetFileName"></property>
<property xmlns:ns2="http://org.apache.synapse/xsd" xmlns:ns="http://org.apache.synapse/xsd" name="ADDRESS_URI" expression="$func:addressUri"></property>
</log>
<property xmlns:ns2="http://org.apache.synapse/xsd" xmlns:ns="http://org.apache.synapse/xsd" name="transport.vfs.ReplyFileName" expression="fn:concat($func:targetFileName, '-', get-property('SYSTEM_DATE', 'yyMMddHHmmss') , '.xml')" scope="transport" type="STRING"></property>
<property name="OUT_ONLY" value="true"></property>
<send>
<endpoint name="ep" template="FileOutEndpointTemplate" uri="$func:addressUri">
<axis2ns117:parameter xmlns:axis2ns117="http://ws.apache.org/ns/synapse" name="retries" value="3"></axis2ns117:parameter>
<axis2ns118:parameter xmlns:axis2ns118="http://ws.apache.org/ns/synapse" name="codes" value="1001"></axis2ns118:parameter>
<axis2ns119:parameter xmlns:axis2ns119="http://ws.apache.org/ns/synapse" name="factor" value="1.0"></axis2ns119:parameter>
</endpoint>
</send>
</sequence>
</template>
ENDPOINT TEMPLATE-
<template xmlns="http://ws.apache.org/ns/synapse" name="FileOutEndpointTemplate">
<axis2ns131:parameter xmlns:axis2ns131="http://ws.apache.org/ns/synapse" name="codes"></axis2ns131:parameter>
<axis2ns132:parameter xmlns:axis2ns132="http://ws.apache.org/ns/synapse" name="factor"></axis2ns132:parameter>
<axis2ns133:parameter xmlns:axis2ns133="http://ws.apache.org/ns/synapse" name="retries"></axis2ns133:parameter>
<endpoint name="$name">
<address uri="$uri">
<suspendOnFailure>
<errorCodes>$codes</errorCodes>
<progressionFactor>$factor</progressionFactor>
</suspendOnFailure>
<markForSuspension>
<retriesBeforeSuspension>$retries</retriesBeforeSuspension>
<retryDelay>0</retryDelay>
</markForSuspension>
</address>
</endpoint>
</template>
I have tried several variations on the $Uri in particular and I cannot get it to work. Essentially, here is the error I am getting:
2015-09-17 16:23:31,026 [-] [SynapseWorker-19] ERROR ClientUtils The system cannot infer the transport information from the $func:addressUri URL.
2015-09-17 16:23:31,026 [-] [SynapseWorker-19] ERROR Axis2Sender Unexpected error during sending message out
org.apache.axis2.AxisFault: The system cannot infer the transport information from the $func:addressUri URL.
I would appreciate any recommendation anyone would have to configure this line:
<endpoint name="ep" template="FileOutEndpointTemplate" uri="$func:addressUri">
Especially how to code the parameter addressUri being passed in from the sequence template call in my sequence.
Address endpoint doesn't support dynamic endpoints. So you can't pass a dynamic value ($func:addressUri is dynamic) to uri parameter of template endpoint. Hence if you want to have a dynamic endpoint, then you can use a default endpoint together with a "To" header which you can set dynamically. Here is the changes to your artifacts.
No changes to your sequence
Set To header using header mediator in your sequence template just before the send mediator, as shown below.
<template xmlns="http://ws.apache.org/ns/synapse" name="FileWriteTemplate">
<parameter name="targetFileName"></parameter>
<parameter name="addressUri"></parameter>
<sequence>
<log level="custom">
<property xmlns:ns2="http://org.apache.synapse/xsd" xmlns:ns="http://org.apache.synapse/xsd" name="TARGET_FILE_NAME" expression="$func:targetFileName"></property>
<property xmlns:ns2="http://org.apache.synapse/xsd" xmlns:ns="http://org.apache.synapse/xsd" name="ADDRESS_URI" expression="$func:addressUri"></property>
</log>
<property xmlns:ns2="http://org.apache.synapse/xsd" xmlns:ns="http://org.apache.synapse/xsd" name="transport.vfs.ReplyFileName" expression="fn:concat($func:targetFileName, '-', get-property('SYSTEM_DATE', 'yyMMddHHmmss') , '.xml')" scope="transport" type="STRING"></property>
<property name="OUT_ONLY" value="true"></property>
<header name="To" expression="$func:addressUri"/>
<send>
<endpoint name="ep" template="FileOutEndpointTemplate">
<axis2ns117:parameter xmlns:axis2ns117="http://ws.apache.org/ns/synapse" name="retries" value="3"></axis2ns117:parameter>
<axis2ns118:parameter xmlns:axis2ns118="http://ws.apache.org/ns/synapse" name="codes" value="1001"></axis2ns118:parameter>
<axis2ns119:parameter xmlns:axis2ns119="http://ws.apache.org/ns/synapse" name="factor" value="1.0"></axis2ns119:parameter>
</endpoint>
</send>
</sequence>
</template>
Change address endpoint to default endpoint in your endpoint template, as shown below
<template xmlns="http://ws.apache.org/ns/synapse" name="FileOutEndpointTemplate">
<axis2ns131:parameter xmlns:axis2ns131="http://ws.apache.org/ns/synapse" name="codes"></axis2ns131:parameter>
<axis2ns132:parameter xmlns:axis2ns132="http://ws.apache.org/ns/synapse" name="factor"></axis2ns132:parameter>
<axis2ns133:parameter xmlns:axis2ns133="http://ws.apache.org/ns/synapse" name="retries"></axis2ns133:parameter>
<endpoint name="$name">
<default>
<suspendOnFailure>
<errorCodes>$codes</errorCodes>
<progressionFactor>$factor</progressionFactor>
</suspendOnFailure>
<markForSuspension>
<retriesBeforeSuspension>$retries</retriesBeforeSuspension>
<retryDelay>0</retryDelay>
</markForSuspension>
</default>
</endpoint>
</template>
The idea behind this solution is that you can set To header dynamically and the default endpoint will send the messages out to the endpoint found in "To" header.
Refer this for more details.
1
I want to get text from following Envelope so that I can use it as REST_URL_POSTFIX.
I am sending a plain text message to a JMS queue and following WSO2-ESB proxy service is used as a receiver/listener of JMS queue. I have tried following expressions but they does not work :
$body
$body/text
$body/text()
The SOAP 1.1 or 1.2 body element. For example, the expression
$body/getQuote refers to the first getQuote element in a SOAP body,
regardless of whether the message is SOAP-11 or SOAP-12.
and
//Envelope//Body//text
//Envelope//Body//text()
INFO - (Send
LogMediator To: , MessageID: ID:sunnydyal-K55VM-44230-1439804805911-3:2:1:1:9,
Direction: request, ##### Message = ,
Envelope:
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<axis2ns8:text xmlns:axis2ns8="http://ws.apache.org/commons/ns/payload">Test</axis2ns8:text>
</soapenv:Body>
</soapenv:Envelope>
#Proxy Service:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="JmsToRestProxy"
transports="jms"
statistics="enable"
trace="enable"
startOnLoad="true">
<target>
<inSequence>
<property name="OUT_ONLY" value="true"/>
<property name="HTTP_METHOD" value="GET" scope="axis2" type="STRING"/>
<property name="SOAPAction" scope="default" action="remove"/>
<header name="Action" scope="default" action="remove"/>
<property name="REST_URL_POSTFIX"
expression="//Envelope//Body//text"
scope="axis2"
type="STRING"/>
<switch source="$axis2:HTTP_METHOD">
<case regex="GET">
<property name="HTTP_METHOD" value="GET" scope="axis2" type="STRING"/>
</case>
<case regex="POST">
<property name="HTTP_METHOD" value="POST" scope="axis2" type="STRING"/>
</case>
<default/>
</switch>
<log level="full">
<property name="##### Message" expression="$body/text"/>
</log>
<send>
<endpoint>
<address uri="http://localhost:8080/Rest/rest" format="rest"/>
</endpoint>
</send>
</inSequence>
</target>
<parameter name="transport.jms.ContentType">
<rules>
<jmsProperty>contentType</jmsProperty>
<default>text/plain</default>
</rules>
</parameter>
<description/>
</proxy>
text node belong to a specific namespace "http://ws.apache.org/commons/ns/payload" :
<log level="full">
<property xmlns:syn="http://ws.apache.org/commons/ns/payload" name="##### Message" expression="$body/syn:text/text()"/>
</log>
You can get the body using the $body variable[1]. /text() is trying to access the text element of the body which doesn't exist.
<log level="custom">
<property name="Body" expression="$body" />
</log>
[1] - https://docs.wso2.com/display/ESB481/Synapse+XPath+Variables#SynapseXPathVariables-$body
The Endpoint_BPS_CreateCaseService/UpdateCaseService endpoints below both point to one-way BPEL services running on WSO2 BPS. WSO2 BPS returns a HTTP 202 accepted message instantly when they are invoked.
The client application that I am using will throw a fault if it does not get a valid SOAP envelope as a response so I'm going to use a proxy service in ESB to wrap around the BPEL process.
How do I use a WSO2 ESB proxy service to forward a SOAP envelope to Endpoint_BPS_* below and then return a SOAP envelope response to my client app?
I also want to execute the faultSequence "ProcessFault" if either endpoint is unavailable or times out. I previously used the OUT_ONLY to get around the response issue above but it means I can't detect endpoint problems. Unless it is possible to do both somehow?
Another thing I've tried is cloning the message but this was a bit messy.
Any help greatly appreciated
<proxy xmlns="http://ws.apache.org/ns/synapse" name="BPSProxyService" transports="https,http" statistics="disable" trace="enable" startOnLoad="true">
<target faultSequence="ProcessFault">
<inSequence>
<log level="full">
<property name="MESSAGE" value="BEGIN BPSProxyService" />
</log>
<switch source="//*[local-name()='Operation']">
<case regex="create">
<send>
<endpoint key="Endpoint_BPS_CreateCaseService" />
</send>
</case>
<case regex="update">
<send>
<endpoint key="Endpoint_BPS_UpdateCaseService" />
</send>
</case>
</switch>
</inSequence>
<outSequence>
<property name="HTTP_SC" value="200" scope="axis2" />
<class name="esb.mediators.InjectSOAPEnvelope" />
<log level="full">
<property name="MESSAGE" value="END BPSProxyService" />
</log>
<send />
<drop />
</outSequence>
</target>
<publishWSDL key="common/bpsproxyservice/bpsproxyservice.wsdl">
<resource location="schema.xsd" key="common/schema_v2.xsd" />
</publishWSDL>
</proxy>
When you receive a 'HTTP/1.1 202 Accepted' response from your backend like BPS in the outSequence of your Proxy Service, then you need the <property name="SC_ACCEPTED" value="false" scope="axis2"/> statement to modify the '202'-response into something else.
Example:
<property name="SC_ACCEPTED" value="false" scope="axis2"/>
<property name="HTTP_SC" value="200" scope="axis2"/>
<payloadFactory media-type="xml">
<format>
<response>
<result>OK</result>
</response>
</format>
<args/>
</payloadFactory>
<send/>
The response is transformed into 'HTTP/1.1 200 OK' with a response message.
Add the "FORCE_SC_ACCEPTED" parameter with the "OUT_ONLY" in the inSequence of the proxy service as follows.
<property name="FORCE_SC_ACCEPTED" value="true" scope="axis2" type="STRING"/>
<property name="OUT_ONLY" value="true" scope="default" type="STRING"/>
For more information use the following article:
http://mohanadarshan.wordpress.com/2013/05/05/out_only-scenario-in-proxy-service-wso2-esb/