how to send response as String using class mediator in wso2 esb - wso2-esb

In my project I created some proxy.There transport type is tcp.
My response is
{
"BillingSystem": {
"request_id": "20114140080000011479122000",
"request_timestamp": "12102012121200",
"response_timestamp": "12102012121300",
"action": "AddSubscription",
"username": "Cellcard ",
"result_code": "0",
"result_desc": "Success"
}
}
I catch this response using class mediator and create WZ2OCS2:1:14:14008:1:#1479122000# using that response. I need to send this string to tcp client. I set this String in the class meditor
context.setProperty("responseClientValue", responseClientValue);
After set this value in class mediator I used payload factory mediator and after that property mediator.
<payloadFactory description="" media-type="xml">
<format>
<name xmlns="">$1</name>
</format>
<args>
<arg evaluator="xml" expression="get-property('responseClientValue')"/>
</args>
</payloadFactory>
property mediator
<property name="messageType" scope="axis2" type="STRING" value="application/text"/>
When I run project Its show xml code
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><name>WZ2OCS2:1:14:14008:1:#1479122000#</name></soapenv:Body></soapenv:Envelope>?
Here is my proxy service
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="SurepayBillingErrorHandlingProxy" startOnLoad="true" transports="tcp" xmlns="http://ws.apache.org/ns/synapse">
<target>
<inSequence>
<class description="" name="esb.cellcard.billing.SurepayMediator"/>
<property name="messageType" scope="axis2" type="STRING" value="application/json"/>
<send>
<endpoint key="SurpayBillingEP"/>
</send>
</inSequence>
<outSequence>
<class name="esb.cellcard.billing.ResponseRequestId"/>
<payloadFactory description="" media-type="xml">
<format>
<name xmlns="">$1</name>
</format>
<args>
<arg evaluator="xml" expression="get-property('responseClientValue')"/>
</args>
</payloadFactory>
<property name="messageType" scope="axis2" type="STRING" value="application/text"/>
<send/>
</outSequence>
<faultSequence/>
</target>
<parameter name="transport.tcp.responseClient">true</parameter>
<parameter name="transport.tcp.inputType">string</parameter>
<parameter name="transport.tcp.recordDelimiter">?</parameter>
<parameter name="transport.tcp.contentType">text/plain</parameter>
<parameter name="transport.tcp.port">6050</parameter>
<parameter name="transport.tcp.recordDelimiterType">character</parameter>
</proxy>
How can I get only string value. Thank you

Change your payloadFactory like this :
<payloadFactory>
<format>
<text xmlns="http://ws.apache.org/commons/ns/payload">$1</text>
</format>
<args>
<arg evaluator="xml" expression="$ctx:responseClientValue"/>
</payloadFactory>
Change property messageType like this :
<property name="messageType" scope="axis2" type="STRING" value="text/plain"/>
(see axis2.xml, by default, the PlainTextFormatter class is associated with text/plain : <messageFormatter contentType="text/plain" class="org.apache.axis2.format.PlainTextFormatter"/>)

Related

Unexpected error during sending message out - ERROR {org.apache.synapse.core.axis2.Axis2Sender}

When i try to call a remote web-service using a dynamic uri-template in send mediator, i receive this error.
The url of the resource to call is : https://ec.europa.eu/esco/api/resource/skill?uri=http://data.europa.eu/esco/skill/a59708e3-e654-4e37-8b8a-741c3b756eee&language=it
For this purpose i use below in-sequence and out-sequence:
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="EscoInSequence" xmlns="http://ws.apache.org/ns/synapse">
<property expression="$url:resource" name="resource" scope="default"
type="STRING" xmlns:ns="http://org.apache.synapse/xsd"/>
<property expression="$url:uri" name="uri"
scope="default" type="STRING" xmlns:ns="http://org.apache.synapse/xsd"/>
<property expression="$url:language" name="language" scope="default"
type="STRING" xmlns:ns="http://org.apache.synapse/xsd"/>
<property
expression="concat('https://ec.europa.eu/esco/api/resource/',$ctx:resource,'?uri=',$ctx:uri,'&language=',$ctx:language)"
name="UrlToEsco" scope="default" type="STRING" xmlns:ns="http://org.apache.synapse/xsd"/>
<payloadFactory media-type="text">
<format>$1</format>
<args>
<arg evaluator="xml" expression="$ctx:UrlToEsco"
literal="false" xmlns:ns="http://org.apache.synapse/xsd"/>
</args>
</payloadFactory>
<send>
<endpoint>
<http method="GET" uri-template="{UrlToEsco}"/>
</endpoint>
</send>
<enrich>
<source clone="true" type="body"/>
<target action="child" property="rispostaEsco" type="property"/>
</enrich>
<loopback/>
</sequence>
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="EscoOutSequence" xmlns="http://ws.apache.org/ns/synapse">
<send/>
</sequence>
When i try to call my api using a static uri ( https://ec.europa.eu/esco/api/resource/skill?uri=http://data.europa.eu/esco/skill/a59708e3-e654-4e37-8b8a-741c3b756eee&language=it ) i haven't problem, but when i use UrlToEsco property i obtain this error :
TID[-1234] [EI] [2019-09-03 12:31:53,029] ERROR
{org.apache.synapse.core.axis2.Axis2Sender} - Unexpected error during
sending message out
org.apache.axis2.description.ClientUtils.inferOutTransport(ClientUtils.java:86)
org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.executeImpl(DynamicAxisOperation.java:116)
org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:603)
org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:85)
org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:547)
org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:384)
org.apache.synapse.endpoints.HTTPEndpoint.send(HTTPEndpoint.java:85)
org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:123)
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:108)
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:70)
org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
org.apache.synapse.rest.Resource.process(Resource.java:364)
org.apache.synapse.rest.API.process(API.java:399)
org.apache.synapse.rest.RESTRequestHandler.apiProcess(RESTRequestHandler.java:123)
org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:101)
org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:69)
org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:303)
org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:92)
org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:337)
org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:158)
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)
Uri templates variables should be named as follows uri.var.[parameterName] so for example uri.var.UrlToEsco.
Try renameing your property
<property expression="concat('https://ec.europa.eu/esco/api/resource/',$ctx:resource,'?
uri=',$ctx:uri,'&language=',$ctx:language)"
name="uri.var.UrlToEsco" scope="default" type="STRING"
xmlns:ns="http://org.apache.synapse/xsd"/>
And using it like so:
<send>
<endpoint>
<http method="GET" uri-template="{uri.var.UrlToEsco}"/>
</endpoint>
</send>

Iterate over DSS(3.2.2) response in WSO2 ESB(4.8.1) not working as expected

I am doing iteration over the DSS response, But not working as expected
Below is the payload and call for DSS:
<payloadFactory media-type="xml">
<format>
<p:getNominaIDDetails xmlns:p="http://ws.wso2.org/dataservice">
<xs:column1 xmlns:xs="http://ws.wso2.org/dataservice">$1</xs:column1>
<xs:column2 xmlns:xs="http://ws.wso2.org/dataservice">$2</xs:column2>
<xs:column3 xmlns:xs="http://ws.wso2.org/dataservice">$3</xs:column3>
<xs:column4 xmlns:xs="http://ws.wso2.org/dataservice">$4</xs:column4>
</p:getNominaIDDetails>
</format>
<args>
<arg xmlns:ns="http://org.apache.synapse/xsd" expression="get-property('column1')" evaluator="xml"></arg>
<arg xmlns:ns="http://org.apache.synapse/xsd" expression="get-property('column2')" evaluator="xml"></arg>
<arg xmlns:ns="http://org.apache.synapse/xsd" expression="get-property('column3')" evaluator="xml"></arg>
<arg xmlns:ns="http://org.apache.synapse/xsd" expression="get-property('column4')" evaluator="xml"></arg>
</args>
</payloadFactory>
<header name="Action" scope="default" value="urn:xxxxxxx"></header>
<call>
<endpoint key="gov:/dss/endpoint"></endpoint>
</call>
<filter xmlns:ns="http://org.apache.synapse/xsd"
xmlns:ds="http://ws.wso2.org/dataservice"
xpath="get-property('db_count')>0">
<then>
<iterate id="xxx"
preservePayload="true"
attachPath="//ds:xxxx"
expression="//ds:xxx/ds:xxx">
<target sequence="My_seq">
</target>
</iterate>
</then>
<else>
<drop/>
</else>
</filter>
Response from the dss is:
<response xmlns="http://ws.wso2.org/dataservice">
<id>
<column1>234</column1>
<column1>4455</column1>
<column1>567778</column1>
</id>
<id>
<column1>546</column1>
<column1>56866</column1>
<column1>464453</column1>
</id>
<id>
<column1>546</column1>
<column1>56866</column1>
<column1>464453</column1>
</id>
</response>
With the above response completing with first iteration and remaining all the messages expiring after global timeout.Below are the logs after first iteration:
{org.apache.synapse.mediators.builtin.LogMediator}
TID: [0] [ESB] [2016-09-04 06:26:13,471] WARN {org.apache.synapse.core.axis2.SynapseCallbackReceiver} - Synapse received a response for the request with message Id : urn:uuid:c62d7dae-5290-49d1-b1bd-b5d2dcba7e04 But a callback is not registered (anymore) to process this response {org.apache.synapse.core.axis2.SynapseCallbackReceiver}
TID: [0] [ESB] [2016-09-04 06:26:42,144] WARN {org.apache.synapse.core.axis2.TimeoutHandler} - Expiring message ID : urn:uuid:36df3897-73be-4bc3-a434-aaab618c7ce3; dropping message after global timeout of : 180 seconds {org.apache.synapse.core.axis2.TimeoutHandler}
TID: [0] [ESB] [2016-09-04 06:26:42,145] WARN {org.apache.synapse.core.axis2.TimeoutHandler} - Expiring message ID : urn:uuid:d8ec8998-95c6-4d70-9e33-c11bda271e90; dropping message after global timeout of : 180 seconds {org.apache.synapse.core.axis2.TimeoutHandler}
Note: inside iterator doing following operations(sequence="My_seq")
perfoming the Bank call-->DSS call-->SAP call using call meditor
<?xml version="1.0" encoding="UTF-8"?>
<sequence xmlns="http://ws.apache.org/ns/synapse" name="My_seq" >
<property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ds="http://ws.wso2.org/dataservice" name="id" expression="//ds:dss_response/ds:Id" scope="default" type="STRING"/>
<payloadFactory media-type="xml">
<format>
<h:opertion xmlns:h="http://ws.wso2.org/xxxxxx">
<h2h:id>$1</h2h:id>
</h:opertion>
</format>
<args>
<arg xmlns:ns="http://org.apache.synapse/xsd" evaluator="xml" expression="get-property('id')"/>
</args>
</payloadFactory>
<property xmlns:ns="http://org.apache.synapse/xsd" name="Authorization" expression="fn:concat('Basic ', base64Encode('xxxxx:xxxxxxxx'))" scope="transport" type="STRING"/>
<property name="ContentType" value="application/soap+xml" scope="axis2" type="STRING"/>
<property name="messageType" value="application/soap+xml" scope="axis2" type="STRING"/>
<call>
<endpoint key="gov:/endpoint"/>
</call>
<sequence key="next_sequence_to_be_DSS_then_SAP"/>
</sequence>
I believe this should suit your requirement. Here I'm checking status of incoming responses and send OK to client only if every request was successful.
<api xmlns="http://ws.apache.org/ns/synapse" name="MyAPI" context="/myapi">
<resource methods="POST GET" url-mapping="/">
<inSequence>
<call blocking="true">
<endpoint>
<http uri-template="http://www.mocky.io/v2/57cd6f422d00000101b15868"/>
</endpoint>
</call>
<property name="Staus" value="OK" type="STRING"/>
<iterate xmlns:ds="http://ws.wso2.org/dataservice" id="xxx" preservePayload="true" expression="//ds:response/ds:id">
<target>
<sequence>
<send>
<endpoint>
<http uri-template="http://www.mocky.io/v2/57cd70c22d00002401b1586c"/>
</endpoint>
</send>
</sequence>
</target>
</iterate>
</inSequence>
<outSequence>
<filter source="$axis2:HTTP_SC" regex="200">
<then/>
<else>
<property name="Staus" value="NOT OK" type="STRING"/>
</else>
</filter>
<aggregate id="xxx">
<completeCondition>
<messageCount/>
</completeCondition>
<onComplete xmlns:ds="http://ws.wso2.org/dataservice" expression="/">
<log level="custom">
<property name="Final Staus" expression="$ctx:Staus"/>
</log>
<payloadFactory media-type="xml">
<format>
<status>$1</status>
</format>
<args>
<arg evaluator="xml" expression="$ctx:Status"/>
</args>
</payloadFactory>
<send/>
</onComplete>
</aggregate>
</outSequence>
</resource>
</api>

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>

wso2esb 4.8.1 and 4.9.0 different behaviour onError

I have a registered onError sequence.
In version 4.8.1 SOAP envelop is available in onError sequence
while in 4.9.0 it is not.
in order to access SOAP message content in 4.9.0 after error (in onError sequence) I always have to copy it to some temp variable initially. it is very inconvenient.
could it be a bug or is it a new "feature" of 4.9.0?
this is my fault sequence. if i remove enrich mediator envelope comes empty from the sequence with an error. Without enrich mediator message contains empty soap envelope. It can be seen in the output of the log mediator and in the message stored in RabbitMQ backend. Actually, it is onError sequence of XXXXNotifySendSequence sequence (I added them both for the reference).
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="XXXXNotifyErrorSequence" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<log level="full">
<property name="mssg" expression="get-property('mssg')"/>
<property name="retry_count" expression="get-property('retry_count')"/>
</log>
<filter xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xpath="get-property('mssg')">
<then>
<enrich>
<source clone="true" property="mssg" type="property"/>
<target type="envelope"/>
</enrich>
<property name="mssg" action="remove"/>
</then>
<else/>
</filter>
<filter xmlns:ns="http://org.apache.synapse/xsd" xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:ns3="http://org.apache.synapse/xsd" xpath="get-property('retry_count')">
<then>
<property name="retry_count" expression="number(get-property('retry_count'))+1" scope="default" type="STRING"/>
<filter xpath="get-property('retry_count') > 5">
<then>
<log>
<property name="Dropping--Count" expression="get-property('retry_count')"/>
</log>
<drop/>
</then>
<else>
<sequence key="XXXXNotifySendSequence"/>
</else>
</filter>
</then>
<else>
<property name="retry_count" value="1" scope="default" type="STRING"/>
<clone continueParent="true">
<target>
<sequence>
<makefault version="soap11">
<code xmlns:soap11Env="http://schemas.xmlsoap.org/soap/envelope/" value="soap11Env:VersionMismatch"/>
<reason expression="get-property('ERROR_MESSAGE')"/>
</makefault>
<send/>
</sequence>
</target>
</clone>
</else>
</filter>
<clone>
<target>
<sequence>
<log level="custom">
<property name="STORE" value="store the message"/>
</log>
<store messageStore="XXXXRabbitMQNative"/>
</sequence>
</target>
</clone>
</sequence>
this is the sequence calling onError sequence
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="XXXXNotifySendSequence"
onError="XXXXNotifyErrorSequence" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<log level="full">
<property name="XXXX" value="request start"/>
</log>
<enrich>
<source clone="true" type="envelope"/>
<target property="mssg" type="property"/>
</enrich>
<property name="DISABLE_CHUNKING" scope="axis2" type="STRING" value="true"/>
<call>
<endpoint key="HTTPEndpoint"/>
</call>
<log level="full">
<property name="XXXX" value="request end"/>
</log>
</sequence>
I am not much sure why you written fault sequence in that way. but when i change like bellow its working. no need to enrich and assign to other property
Sequence:(same as yours - untouched)
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="XXXXNotifySendSequence"
onError="XXXXNotifyErrorSequence" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<log level="full">
<property name="XXXX" value="request start"/>
</log>
<enrich>
<source clone="true" type="envelope"/>
<target action="replace" property="mssg" type="property"/>
</enrich>
<property name="DISABLE_CHUNKING" scope="axis2" type="STRING" value="true"/>
<call>
<endpoint key="HTTPEndpoint"/>
</call>
<log level="full">
<property name="XXXX" value="request end"/>
</log>
</sequence>
fault sequence:
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="XXXXNotifyErrorSequence" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<log>
<property expression="get-property('ERROR_CODE')"
name="========error-code=========" xmlns:ns="http://org.apache.synapse/xsd"/>
<property expression="get-property('ERROR_MESSAGE')"
name="========error-message=========" xmlns:ns="http://org.apache.synapse/xsd"/>
</log>
<makefault version="soap11">
<code value="soap11Env:VersionMismatch" xmlns:soap11Env="http://schemas.xmlsoap.org/soap/envelope/"/>
<reason expression="get-property('ERROR_MESSAGE')" xmlns:ns="http://org.apache.synapse/xsd"/>
<role>sample</role>
<detail>sample detail</detail>
</makefault>
<send/>
</sequence>
proxy: to call sequence
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="samplecall"
transports="http,https"
statistics="disable"
trace="disable"
startOnLoad="true">
<target inSequence="XXXXNotifySendSequence"/>
<description/>
</proxy>
response: (since end point is not defined)
<soapenv:Fault xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<faultcode xmlns:soap11Env="http://schemas.xmlsoap.org/soap/envelope/">soap11Env:VersionMismatch</faultcode>
<faultstring>Couldn't find the endpoint with the key : HTTPEndpoint</faultstring>
<faultactor>sample</faultactor>
<detail>sample detail</detail>
</soapenv:Fault>
in log:
2015-11-08 17:19:55,250] INFO - LogMediator To: /services/samplecall.samplecallHttpSoap11Endpoint, WSAction: urn:mediate, SOAPAction: urn:mediate, MessageID: urn:uuid:106d763f-cdc1-43d2-98a9-63d22d17eb81, Direction: request, XXXX = request start, Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body/></soapenv:Envelope>
[2015-11-08 17:19:55,252] INFO - LogMediator To: /services/samplecall.samplecallHttpSoap11Endpoint, WSAction: urn:mediate, SOAPAction: urn:mediate, MessageID: urn:uuid:106d763f-cdc1-43d2-98a9-63d22d17eb81, Direction: request, ========error-code========= = 305100, ========error-message========= = Couldn't find the endpoint with the key : HTTPEndpoint

Issue in getting response back while connecting to Oracle DB in WSO2 esb

I am working on sample application in WSO2 esb
which connects to Oracle Database and return the response of a query. Below mentioned is my service. Issue I am facing is I am not getting the response back after execution of service.However I am able to see the value returned as a query response, but not able to render it in response document.
Can anybody suggest, what I am missing?
DB credentials fields have been hashed.
Proxy :
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="getEmployeeDetails"
transports="https,http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<property name="OUT_ONLY" value="true" scope="default" type="BOOLEAN"/>
<log level="full" category="DEBUG"/>
<dblookup>
<connection>
<pool>
<password>****</password>
<user>****</user>
<url>****</url>
<driver>oracle.jdbc.xa.client.OracleXADataSource</driver>
</pool>
</connection>
<statement>
<sql>select firstname from employee where lastname = 'pawar'</sql>
<result name="firstname" column="firstname"/>
</statement>
</dblookup>
<log level="custom">
<property name="firstname" expression="get-property('firstname')"/>
</log>
<payloadFactory media-type="xml">
<format>
<GetEmployeeDetailsResponse xmlns="">
<out>$1</out>
</GetEmployeeDetailsResponse>
</format>
<args>
<arg evaluator="xml" expression="get-property('firstname')"/>
</args>
</payloadFactory>
</inSequence>
<outSequence>
<log level="full" category="DEBUG"/>
</outSequence>
</target>
<publishWSDL uri="file:/development/data/wso2/wsdl/Employee.wsdl"/>
<description/>
</proxy>
You have to send back the message generated by your payloadFactory in your inSequence :
<header name="To" action="remove"/>
<property name="RESPONSE" value="true" scope="default" type="STRING"/>
<property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
<send/>
Your mediation is "OUT_ONLY", so, your outSequence will never been executed