Wso2 EI 7.1.0 response processing slow - wso2

I am using Wso2 EI 7.1.0 for one of my ESB use case. I implemented flow like API mediator-->Iterate mediator-->Send mediator--->Aggregate--->Payload Factory--->Respond, here I am facing more time taking at Payload Factory while responding, I am using default configurations and I tested this at Linux 16 Core + 32 GB RAM server. I am adding template XML, please assist.
<?xml version="1.0" encoding="UTF-8"?>
<api context="/cbr" name="CBRAPI" xmlns="http://ws.apache.org/ns/synapse">
<resource methods="POST">
<inSequence>
<script language="groovy"><![CDATA[def start_time = System.currentTimeMillis();
mc.setProperty('start_time',start_time);]]></script>
<class description="" name="com.custom.wso2.plugin.ot.CacheBuildMediator">
<property name="DB_CONFIG" value="jdbc:mysql://<IP>:3306/WSO2,user,password,com.mysql.cj.jdbc.Driver"/>
</class>
<propertyGroup>
<property name="TRIGGER_NAME" scope="default" type="STRING" value="TIG1"/>
<property expression="//soapenv:Envelope" name="payload" scope="default" type="STRING" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wos="http://www.huawei.com/bme/cbsinterface/woservices"/>
<property expression="//soapenv:Envelope/soapenv:Body/wos:WorkOrderRequestMsg/WorkOrderRequest/wos:OrderParam[wos:Code='SubscriberNo']/wos:Value" name="SubscriberNo" scope="axis2" type="STRING" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wos="http://www.huawei.com/bme/cbsinterface/woservices"/>
<property expression="//soapenv:Envelope/soapenv:Body/wos:WorkOrderRequestMsg/WorkOrderRequest/wos:OrderParam[wos:Code='RechargeAmount']/wos:Value" name="RechargeAmount" scope="axis2" type="STRING" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wos="http://www.huawei.com/bme/cbsinterface/woservices"/>
<property expression="//soapenv:Envelope/soapenv:Body/wos:WorkOrderRequestMsg/WorkOrderRequest/wos:OrderParam[wos:Code='RechargeChannelID']/wos:Value" name="RechargeChannelID" scope="axis2" type="STRING" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wos="http://www.huawei.com/bme/cbsinterface/woservices"/>
<property expression="//soapenv:Envelope/soapenv:Body/wos:WorkOrderRequestMsg/WorkOrderRequest/wos:OrderParam[wos:Code='RechargeType']/wos:Value" name="RechargeType" scope="axis2" type="STRING" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wos="http://www.huawei.com/bme/cbsinterface/woservices"/>
<property expression="//soapenv:Envelope/soapenv:Body/wos:WorkOrderRequestMsg/WorkOrderRequest/wos:OrderParam[wos:Code='CurrencyID']/wos:Value" name="CurrencyID" scope="axis2" type="STRING" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wos="http://www.huawei.com/bme/cbsinterface/woservices"/>
<property expression="//soapenv:Envelope/soapenv:Body/wos:WorkOrderRequestMsg/WorkOrderRequest/wos:OrderParam[wos:Code='RechargeTime']/wos:Value" name="RechargeTime" scope="axis2" type="STRING" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wos="http://www.huawei.com/bme/cbsinterface/woservices"/>
</propertyGroup>
<class name="com.custom.wso2.plugin.ot.MvelExecuteMediator"/>
<script language="groovy"><![CDATA[def payload=mc.getProperty('RULE_PAYLOAD');
def curr_time=System.currentTimeMillis();
def time= (curr_time- mc.getProperty('start_time'));
mc.setProperty('mvel_exe_time',time);
mc.setProperty('db_report_time',curr_time);
mc.setPayloadXML(payload);]]></script>
<dbreport>
<connection>
<pool>
<driver>com.mysql.cj.jdbc.Driver</driver>
<url>jdbc:mysql://IP:3306/WSO2</url>
<user>user</user>
<password>password</password>
<property name="maxidle" value="10"/>
<property name="initialsize" value="10"/>
<property name="maxactive" value="10"/>
</pool>
</connection>
<statement>
<sql><![CDATA[INSERT INTO `payload_info`(payload,subscriberno,rechargeamount,rechargechannel,rechargetype,currency,rechargetime)VALUES(?,?,?,?,?,?,?);]]></sql>
<parameter expression="get-property('payload')" type="VARCHAR"/>
<parameter expression="get-property('axis2','SubscriberNo')" type="VARCHAR"/>
<parameter expression="get-property('axis2','RechargeAmount')" type="INTEGER"/>
<parameter expression="get-property('axis2','RechargeChannelID')" type="INTEGER"/>
<parameter expression="get-property('axis2','RechargeType')" type="INTEGER"/>
<parameter expression="get-property('axis2','CurrencyID')" type="INTEGER"/>
<parameter expression="get-property('axis2','RechargeTime')" type="VARCHAR"/>
</statement>
</dbreport>
<script language="groovy"><![CDATA[def start_time=mc.getProperty('db_report_time');
def curr_time=System.currentTimeMillis();
def time= (curr_time- start_time);
mc.setProperty('db_report_time',time);
mc.setProperty('end_point_time',curr_time);]]></script>
<filter description="Validate rule" xpath="boolean(get-property('FLOW_CONTINUE'))">
<then>
<class name="com.custom.wso2.plugin.ot.REParamAliasMediator">
<property name="SYNO_NAME_TAGS" value="RechargeAmount,RechargeChannelID,SubscriberNo,RechargeType"/>
</class>
<iterate expression="//rule" id="RULE_LIST_ITERATE">
<target>
<sequence>
<propertyGroup>
<property expression="$body/rule/id" name="rule_id" scope="default" type="STRING"/>
<property expression="$body/rule/url" name="uri.var.url" scope="default" type="STRING"/>
</propertyGroup>
<payloadFactory media-type="json">
<format>{
"requestId":"189898909090",
"timeStamp":"2021/06/28 19:45:52",
"msisdn":"889399977",
"keyWord":"RECHARGE_NOTIFICATION",
"campaignId":"658",
"scheduleId":"$5",
"dataSet":{
"parameters":[
{
"name":"$6",
"value":"$1"
},
{
"name":"$8",
"value":"$2"
},
{
"name":"$7",
"value":"$3"
},
{
"name":"$9",
"value":"0"
},
{
"name":"RECHARGE_DATE",
"value":"$4"
},
{
"name":"RULE_ID",
"value":"$5"
}
]
}
}</format>
<args>
<arg evaluator="xml" expression="get-property('axis2','RechargeAmount')" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wos="http://www.huawei.com/bme/cbsinterface/woservices"/>
<arg evaluator="xml" expression="get-property('axis2','SubscriberNo')" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wos="http://www.huawei.com/bme/cbsinterface/woservices"/>
<arg evaluator="xml" expression="get-property('axis2','RechargeChannelID')" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wos="http://www.huawei.com/bme/cbsinterface/woservices"/>
<arg evaluator="xml" expression="get-property('axis2','RechargeTime')" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wos="http://www.huawei.com/bme/cbsinterface/woservices"/>
<arg evaluator="xml" expression="get-property('rule_id') "/>
<arg evaluator="xml" expression="get-property('axis2','RechargeAmount_alias') "/>
<arg evaluator="xml" expression="get-property('axis2','RechargeChannelID_alias') "/>
<arg evaluator="xml" expression="get-property('axis2','SubscriberNo_alias') "/>
<arg evaluator="xml" expression="get-property('axis2','RechargeType_alias') "/>
</args>
</payloadFactory>
<send>
<endpoint>
<http method="post" uri-template="{uri.var.url}">
<suspendOnFailure>
<initialDuration>-1</initialDuration>
<progressionFactor>1</progressionFactor>
</suspendOnFailure>
<markForSuspension>
<retriesBeforeSuspension>0</retriesBeforeSuspension>
</markForSuspension>
</http>
</endpoint>
</send>
</sequence>
</target>
</iterate>
</then>
<else>
<property name="messageType" scope="axis2" type="STRING" value="application/soap+xml"/>
<payloadFactory media-type="xml">
<format>
<soapenv:Envelope xmlns:cbs="http://www.huawei.com/bme/cbsinterface/cbscommon" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wos="http://www.huawei.com/bme/cbsinterface/woservices">
<soapenv:Body>
<wos:WorkOrderResultMsg>
<ResultHeader>
<cbs:Version>1</cbs:Version>
<cbs:ResultCode>0</cbs:ResultCode>
<cbs:ResultDesc>Operation success.</cbs:ResultDesc>
</ResultHeader>
</wos:WorkOrderResultMsg>
</soapenv:Body>
</soapenv:Envelope>
</format>
<args/>
</payloadFactory>
<respond/>
</else>
</filter>
</inSequence>
<outSequence>
<propertyGroup>
<property name="Aggregated_Responses" scope="default">
<ResponseDetail xmlns=""/>
</property>
<property name="messageType" scope="axis2" type="STRING" value="application/soap+xml"/>
</propertyGroup>
<aggregate id="RULE_LIST_ITERATE">
<completeCondition>
<messageCount max="-1" min="-1"/>
</completeCondition>
<onComplete aggregateElementType="root" enclosingElementProperty="Aggregated_Responses" expression="$body/*[1]">
<script language="groovy"><![CDATA[def start_time=mc.getProperty('end_point_time');
def curr_time=System.currentTimeMillis();
def time= (curr_time- start_time);
mc.setProperty('end_point_time',time);
mc.setProperty('resp_switch_time', curr_time);]]></script>
<filter xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xpath="count( $body//ResponseDetail/jsonObject[responseCode!='SC0000']) >=1">
<then>
<payloadFactory media-type="xml">
<format>
<soapenv:Envelope xmlns:cbs="http://www.huawei.com/bme/cbsinterface/cbscommon" xmlns:wos="http://www.huawei.com/bme/cbsinterface/woservices">
<soapenv:Body>
<wos:WorkOrderResultMsg>
<ResultHeader>
<cbs:Version>1</cbs:Version>
<cbs:ResultCode>1</cbs:ResultCode>
<cbs:ResultDesc>Operation failed.</cbs:ResultDesc>
</ResultHeader>
</wos:WorkOrderResultMsg>
</soapenv:Body>
</soapenv:Envelope>
</format>
<args/>
</payloadFactory>
</then>
<else>
<class name="com.custom.wso2.plugin.ot.REParamAliasMediator">
<property name="ATTRIBUTE_NAME_TAGS" value="Subscriber,Recharge_Amount,Recharge_Channel"/>
</class>
<payloadFactory media-type="xml">
<format>
<soapenv:Envelope xmlns:cbs="http://www.huawei.com/bme/cbsinterface/cbscommon" xmlns:wos="http://www.huawei.com/bme/cbsinterface/woservices">
<soapenv:Body>
<wos:WorkOrderResultMsg>
<ResultHeader>
<cbs:Version>1</cbs:Version>
<cbs:ResultCode>0</cbs:ResultCode>
<cbs:ResultDesc>Operation success.</cbs:ResultDesc>
</ResultHeader>
<WorkOrderResult>
<wos:OrderParam>
<wos:Code>$1</wos:Code>
<wos:Value>$4</wos:Value>
</wos:OrderParam>
<wos:OrderParam>
<wos:Code>$2</wos:Code>
<wos:Value>$5</wos:Value>
</wos:OrderParam>
<wos:OrderParam>
<wos:Code>$3</wos:Code>
<wos:Value>$6</wos:Value>
</wos:OrderParam>
</WorkOrderResult>
</wos:WorkOrderResultMsg>
</soapenv:Body>
</soapenv:Envelope>
</format>
<args>
<arg evaluator="xml" expression="get-property('axis2','Subscriber_alias') "/>
<arg evaluator="xml" expression="get-property('axis2','Recharge_Amount_alias') "/>
<arg evaluator="xml" expression="get-property('axis2','Recharge_Channel_alias') "/>
<arg evaluator="xml" expression="$body//ResponseDetail/jsonObject/dataSets/parameters[name='Subscriber']/value"/>
<arg evaluator="xml" expression="$body//ResponseDetail/jsonObject/dataSets/parameters[name='Recharge_Amount']/value"/>
<arg evaluator="xml" expression="$body//ResponseDetail/jsonObject/dataSets/parameters[name='Recharge_Channel']/value"/>
</args>
</payloadFactory>
</else>
</filter>
<script language="groovy"><![CDATA[def cuur_time=System.currentTimeMillis();
mc.setProperty('total_time',(cuur_time-mc.getProperty('start_time')));
mc.setProperty('resp_switch_time',(cuur_time-mc.getProperty('resp_switch_time')));]]></script>
<log level="custom" separator="|">
<property expression="get-property('total_time')" name="Total time taken"/>
<property expression="get-property('mvel_exe_time')" name="Total Mvel exe time taken"/>
<property expression="get-property('db_report_time')" name="Total DB report time taken"/>
<property expression="get-property('end_point_time')" name="Total End point call time taken"/>
<property expression="get-property('resp_switch_time')" name="Total Resp switch time taken"/>
</log>
<respond/>
</onComplete>
</aggregate>
</outSequence>
<faultSequence>
<property name="messageType" scope="axis2" type="STRING" value="application/soap+xml"/>
<payloadFactory media-type="xml">
<format>
<soapenv:Envelope xmlns:cbs="http://www.huawei.com/bme/cbsinterface/cbscommon" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wos="http://www.huawei.com/bme/cbsinterface/woservices">
<soapenv:Body>
<wos:WorkOrderResultMsg>
<ResultHeader>
<cbs:Version>1</cbs:Version>
<cbs:ResultCode>1</cbs:ResultCode>
<cbs:ResultDesc>Operation failed.</cbs:ResultDesc>
</ResultHeader>
</wos:WorkOrderResultMsg>
</soapenv:Body>
</soapenv:Envelope>
</format>
<args/>
</payloadFactory>
<respond/>
</faultSequence>
</resource>
</api>

Related

Extracting binary as base64 String results in incomplete file?

I am trying to extract binary from soap response and convert it to base64 string but what happens is that I get part of the binary converted to base64 not the full binary data.
Integration Studio : 8.1.0
the soap response is as following :
--A-B--MIME-BOUNDARY--27d99311536fa8c4-18606176189--Y-Z
Content-Transfer-Encoding: binary
Content-Type: application/xop+xml; type="application/soap+xml"; charset=UTF-8
Content-ID:
<v0-27d99311536fa8c4-18606176189#mtom.p8ce.filenet.com>
<?xml version="1.0" encoding="UTF-8"?>
<e:Envelope xmlns:d="http://www.w3.org/2001/XMLSchema" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:fn35="http://www.filenet.com/ns/fnce/2005/02/ws/schema" xmlns:fn40m="http://www.filenet.com/ns/fnce/2006/11/ws/MTOM/schema" xmlns:fn40="http://www.filenet.com/ns/fnce/2006/11/ws/schema" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:e="http://schemas.xmlsoap.org/soap/envelope/">
<e:Body>
<GetContentResponse xmlns="http://www.filenet.com/ns/fnce/2006/11/ws/schema">
<ContentResponse id="1" i:type="fn40:ContentElementResponse" retrievalName="test.pdf" totalSize="4586622" bufferedSize="1048576" continueFrom="offset=1048576;id={B3795692-DA06-468C-AEC9-523A3715455D};">
<SourceSpecification i:type="fn40:ObjectReference" classId="Document" objectId="{E408981D-FF67-4D91-B7A9-CEBEC4630AB0}" objectStore="MCIDEV"></SourceSpecification>
<ElementSpecification elementSequenceNumber="0"></ElementSpecification>
<Content i:type="fn40:InlineContent">
<Binary>
<xop:Include href="cid:v1-27d99311536fa8c4-18606176189#mtom.p8ce.filenet.com"></xop:Include>
</Binary>
</Content>
</ContentResponse>
</GetContentResponse>
</e:Body>
</e:Envelope>
--A-B--MIME-BOUNDARY--27d99311536fa8c4-18606176189--Y-Z
Content-Transfer-Encoding: binary
Content-Type: application/octet-stream
Content-Id:
<v1-27d99311536fa8c4-18606176189#mtom.p8ce.filenet.com>
%PDF-1.4
......
......
......
--A-B--MIME-BOUNDARY--27d99311536fa8c4-18606176189--Y-Z--
The code to extract the binary and convert it to base64 string is as follows :
<property expression="$body/fn:GetContentResponse/fn:ContentResponse/fn:Content/fn:Binary" name="DataBase64" scope="default" type="STRING" xmlns:fn="http://www.filenet.com/ns/fnce/2006/11/ws/schema"/>
My service code is as follows :
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="StorageGetDocumentSeq" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<propertyGroup>
<property expression="json-eval($.username)" name="Username" scope="default" type="STRING"/>
<property expression="json-eval($.password)" name="Password" scope="default" type="STRING"/>
<property expression="json-eval($.objectStore)" name="ObjectStore" scope="default" type="STRING"/>
<property name="DocumentClass" scope="default" type="STRING" value="Document"/>
<property expression="json-eval($.documentId)" name="DocumentId" scope="default" type="STRING"/>
<property expression="json-eval($.version)" name="Version" scope="default" type="STRING"/>
</propertyGroup>
<sequence key="StorageRequestValidatorSeq"/>
<script description="Response Builder" language="js"><![CDATA[var errors = [];
var errorProperties = mc.getPropertyKeySet();
var it = errorProperties.iterator();
var i = 1;
while(it.hasNext()){
var prop = it.next();
if (prop.contains('Error')) {
print(prop.toString());
errors.push(mc.getProperty(prop));
}
}
mc.setProperty('errorList', "[" + errors.toString() + "]");]]></script>
<filter regex="false" source="get-property('IsValid')">
<then>
<payloadFactory description="Response Payload" media-type="json">
<format>
{"errorCode":400,"errorMessage":"One or more validation error","errorList":$1}</format>
<args>
<arg evaluator="xml" expression="get-property('errorList')"/>
</args>
</payloadFactory>
<property description="Set 400 response code" name="HTTP_SC" scope="axis2" type="STRING" value="400"/>
<respond description="Response to client"/>
</then>
<else/>
</filter>
<sequence key="StorageGetMimeTypeSeq"/>
<payloadFactory media-type="xml">
<format>
<soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext">
<hd:UsernameToken xmlns:hd="http://schemas.xmlsoap.org/ws/2002/12/secext">
<hd:Username>$1</hd:Username>
<hd:Password>$2</hd:Password>
</hd:UsernameToken>
</Security>
</soapenv:Header>
<soapenv:Body>
<p857:GetContentRequest validateOnly="0" xmlns:p857="http://www.filenet.com/ns/fnce/2006/11/ws/schema">
<p857:ContentRequest continueFrom="" cacheAllowed="1" id="1" startOffset="0">
<p857:SourceSpecification classId="$4" itemIndex="0" objectId="$5" objectStore="$3"
serializationDuplicate="0" xsi:type="p857:ObjectSpecification"/>
<p857:ElementSpecification elementSequenceNumber="0" itemIndex="0"/>
</p857:ContentRequest>
</p857:GetContentRequest>
</soapenv:Body>
</soapenv:Envelope>
</format>
<args>
<arg evaluator="xml" expression="get-property('Username')"/>
<arg evaluator="xml" expression="get-property('Password')"/>
<arg evaluator="xml" expression="get-property('ObjectStore')"/>
<arg evaluator="xml" expression="get-property('DocumentClass')"/>
<arg evaluator="xml" expression="get-property('DocumentId')"/>
</args>
</payloadFactory>
<call-template target="StorageEndpointTemplate"/>
<propertyGroup>
<property expression="$axis2:HTTP_SC" name="HTTPStatus" scope="default" type="STRING"/>
<property expression="$body/e:Fault/e:Reason/e:Text" name="ErrorMessage" scope="default" type="STRING" xmlns:e="http://www.w3.org/2003/05/soap-envelope"/>
<property expression="$body/fn:GetContentResponse/fn:ContentResponse/#retrievalName" name="FileName" scope="default" type="STRING" xmlns:fn="http://www.filenet.com/ns/fnce/2006/11/ws/schema"/>
<property expression="$body/fn:GetContentResponse/fn:ContentResponse/#totalSize" name="FileSize" scope="default" type="STRING" xmlns:fn="http://www.filenet.com/ns/fnce/2006/11/ws/schema"/>
<property expression="$body/fn:GetContentResponse/fn:ContentResponse/fn:Content/fn:Binary" name="DataBase64" scope="default" type="STRING" xmlns:fn="http://www.filenet.com/ns/fnce/2006/11/ws/schema"/>
</propertyGroup>
<log level="headers"/>
<log level="custom">
<property expression="get-property('FileName')" name="FileNameLog"/>
<property expression="get-property('FileSize')" name="FileSizeLog"/>
</log>
<filter regex="true" source="boolean(get-property('ErrorMessage'))=''">
<then>
<payloadFactory media-type="json">
<format>
{
"fileName":"$1",
"fileSize": $2,
"mimeType":"$3",
"dataBase64":"$4"
}
</format>
<args>
<arg evaluator="xml" expression="get-property('FileName')"/>
<arg evaluator="xml" expression="get-property('FileSize')"/>
<arg evaluator="xml" expression="get-property('MimeType')"/>
<arg evaluator="xml" expression="get-property('DataBase64')"/>
</args>
</payloadFactory>
</then>
<else>
<property name="HTTP_SC" scope="axis2" type="STRING" value="400"/>
<payloadFactory description="Response Payload" media-type="json">
<format>{"errorCode": "$1","errorMessage": "$2"}</format>
<args>
<arg value="400"/>
<arg evaluator="xml" expression="get-property('ErrorMessage')"/>
</args>
</payloadFactory>
</else>
</filter>
</sequence>
EDIT : I also tried the base64Encode as follows :
<property expression="base64Encode($body/fn:GetContentResponse/fn:ContentResponse/fn:Content/fn:Binary)" name="DataBase64" scope="default" type="STRING" xmlns:fn="http://www.filenet.com/ns/fnce/2006/11/ws/schema"/>
And it also results in corrupted base64String
I found out that the issue was not related to WSO2 at all but a filenet limitation
Inline Content Retrieval Limit default is 1 MB so that filenet API itself was returning 1 MB only of the file.
https://www.ibm.com/docs/en/filenet-p8-platform/5.5.x?topic=engine-improving-content-uploads-downloads

WSO2 EI 6.3.0 Log Error while loading the registry resource

I have a proxy in WSO2 Enterprise Integrator 6.3.0 with endpoint configured in conf registry. Sometimes I receive errors in this proxy with message in LOG:
[2018-09-12 09:33:22,542] [-1234] [] [SynapseWorker-11] ERROR {org.apache.synapse.config.xml.endpoints.LoadbalanceEndpointFactory} - Invalid endpoint configuration.
[2018-09-12 09:33:22,542] [-1234] [] [SynapseWorker-11] WARN {org.apache.synapse.config.SynapseConfiguration} - Error while loading the resource conf:services/corp/servicev1/endpoint/ERPEndpoint.xml from the remote registry. Previously cached value will be used. Check the registry accessibility.
[2018-09-12 09:33:22,545] [-1234] [] [SynapseWorker-11] INFO {org.apache.axis2.transport.http.HTTPSender} - Unable to sendViaPost to url[http://...address ommited...]
java.net.SocketException: Connection reset
It seems to me it doesn't catch the endpoint of registry or cache.
PS: In my registry the address endpoint is with dns name and when this error occurs the address endpoint appears with IP address.
How to fix this?
Below the sequence and endpoint:
<sequence name="PessoaService_inserirPessoaFisicaNacionalV1_MessageProcessorSequence" onError="PessoaService_GenericFaultHandlerSequence" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<property name="PROXY_NAME" scope="default" type="STRING" value="PessoaService_inserirPessoaFisicaNacionalV1_LocalProxy"/>
<property name="SERVICE_VERSION" scope="default" type="STRING" value="1.0"/>
<property expression="$header/wsa:MessageID" name="MessageIdConsumidor" scope="default" type="STRING" xmlns:wsa="http://www.w3.org/2005/08/addressing"/>
<property expression="$header/ns:ApplicationName" name="applicationName" scope="default" type="STRING" xmlns:ns="https://ws.apache.org/axis2"/>
<log level="custom">
<property name="PessoaService_inserirPessoaFisicaNacionalV1_MessageProcessorSequence" value="Started"/>
</log>
<enrich>
<source clone="true" type="envelope"/>
<target property="BODY_ORIGINAL" type="property"/>
</enrich>
<dblookup>
<connection>
<pool>
<dsName>ESB</dsName>
</pool>
</connection>
<statement>
<sql>
<![CDATA[select codigo_configuracao, cnpj_empresa from esb.codigo_configuracao where aplicacao = ? and tipo_pessoa = 'fisica']]>
</sql>
<parameter expression="get-property('applicationName')" type="CHAR"/>
<result column="codigo_configuracao" name="codigo_configuracao"/>
<result column="cnpj_empresa" name="cnpj_empresa"/>
</statement>
</dblookup>
<log level="custom">
<property expression="$ctx:codigo_configuracao" name="PessoaService_inserirPessoaFisicaNacionalV1 [codigo_configuracao]"/>
<property expression="$ctx:cnpj_empresa" name="PessoaService_inserirPessoaFisicaNacionalV1 [cnpj_empresa]"/>
<property expression="get-property('applicationName')" name="PessoaService_inserirPessoaFisicaNacionalV1 [applicationName]"/>
</log>
<call-template target="PessoaService_LoginTemplate">
<with-param name="username" value="username"/>
<with-param name="password" value="pass"/>
<with-param name="companyHandle" value="-1"/>
<with-param name="branchHandle" value="-1"/>
</call-template>
<xslt key="conf:services/corp/pessoaservicev1/transformation/InserirPessoaFisicaNacionalRequest_IntegrarRequestTransformation.xslt">
<property expression="$ctx:AuthenticationTokenId" name="AuthenticationTokenId"/>
<property expression="$ctx:cnpj_empresa" name="cnpjEmpresa"/>
<property expression="$ctx:codigo_configuracao" name="codigoConfiguracao"/>
</xslt>
<log level="custom">
<property expression="$body" name="PessoaService_inserirPessoaFisicaNacionalV1_MessageProcessorSequence [request ERP]"/>
</log>
<enrich>
<source clone="true" type="body"/>
<target property="RequestERP" type="property"/>
</enrich>
<header action="remove" name="Action" scope="default"/>
<header name="Action" scope="default" value="http://.com.br/corporativo/PessoaService/Pessoa/Integrar"/>
<property expression="get-property('registry', 'conf:services/corp/pessoaservicev1/parameters/endpointCallback.properties')" name="endpointCallback" scope="default" type="STRING"/>
<payloadFactory media-type="xml">
<format>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Action>$1</wsa:Action>
<wsa:ReplyTo>
<wsa:Address>$2</wsa:Address>
</wsa:ReplyTo>
<wsa:MessageID>$3</wsa:MessageID>
</soap:Header>
<soap:Body>$4</soap:Body>
</soap:Envelope>
</format>
<args>
<arg value="http://.com.br/corporativo/PessoaService/Pessoa/Integrar"/>
<arg evaluator="xml" expression="$ctx:endpointCallback"/>
<arg evaluator="xml" expression="get-property('MessageID')"/>
<arg evaluator="xml" expression="$body/pes:Integrar" xmlns:pes="http://.com.br/corporativo/PessoaService"/>
</args>
</payloadFactory>
<call blocking="true">
<endpoint key="conf:services/corp/pessoaservicev1/endpoint/ERPEndpoint.xml"/>
</call>
<log level="custom">
<property expression="$body" name="PessoaService_inserirPessoaFisicaNacionalV1_MessageProcessorSequence [ERP Response]"/>
</log>
<filter xmlns:ns="http://.com.br/corporativo/PessoaService" xpath="$body//ns:CodigoRetorno = 'ProcessamentoOK'">
<then>
<call-template target="PessoaService_LogoutTemplate">
<with-param name="AuthenticationTokenId" value="{$ctx:AuthenticationTokenId}"/>
</call-template>
</then>
<else>
<call-template target="PessoaService_LogoutTemplate">
<with-param name="AuthenticationTokenId" value="{$ctx:AuthenticationTokenId}"/>
</call-template>
<property expression="get-property('ReplyTo')" name="uri.var.full" scope="default" type="STRING"/>
<log level="custom">
<property expression="get-property('ReplyTo')" name="PessoaService_inserirPessoaFisicaNacionalV1_MessageProcessorSequence [Processamento NOK - callback endpoint]"/>
</log>
<call>
<endpoint key="conf:services/corp/pessoaservicev1/endpoint/CallbackDynamicEndpoint.xml"/>
</call>
</else>
</filter>
<payloadFactory media-type="xml">
<format>
<p:insert_smart_proxy_operation xmlns:p="http://ws.wso2.org/dataservice">
<p:message_id>$1</p:message_id>
<p:correlation_id>$2</p:correlation_id>
<p:to_address/>
<p:reply_address>$3</p:reply_address>
<p:message>$4</p:message>
<p:status>OK</p:status>
<p:data_processamento>$5</p:data_processamento>
<p:relates_to>$2</p:relates_to>
</p:insert_smart_proxy_operation>
</format>
<args>
<arg evaluator="xml" expression="get-property('MessageID')"/>
<arg evaluator="xml" expression="get-property('MessageIdConsumidor')"/>
<arg evaluator="xml" expression="get-property('endpointCallback')"/>
<arg evaluator="xml" expression="$ctx:RequestERP/*"/>
<arg evaluator="xml" expression="get-property('SYSTEM_DATE')"/>
</args>
</payloadFactory>
<log level="custom">
<property expression="$body" name="PessoaService_inserirPessoaFisicaNacionalV1 [SmartProxy Request]"/>
</log>
<header name="Action" scope="default" value="urn:insert_smart_proxy_operation"/>
<send>
<endpoint key="conf:services/corp/pessoaservicev1/endpoint/SmartProxyDSSEndpoint.xml"/>
</send>
</sequence>
Content of endpoint ERPEndpoint.xml in sequence above:
<endpoint name="BennerERPEndpoint" xmlns="http://ws.apache.org/ns/synapse">
<address uri="http://host/App_Services/PESSOAS/Service.svc/ws">
<enableAddressing/>
<timeout>
<duration>30000</duration>
<responseAction>fault</responseAction>
</timeout>
</address>
</endpoint>

WSO2 ESB does not sent a clinicId param to WSO2 DSS

In WSO2 configured proxy service, does not send the clinicId param to DSS. In logs from DSS gives exception :
Default Namespace: https://bur.test.ru/dss/services/tfoms
Current Request Name: get_single_inserted_branch_by_id
Current Params: {clinicID=}
Nested Exception:-
java.lang.NumberFormatException: For input string: ""
In logs from ESB:
Nested Exception:-
javax.xml.stream.XMLStreamException: DS Fault Message: Error in 'SQLQuery.processPreNormalQuery': For input string: ""
DS Code: DATABASE_ERROR
Source Data Service:-
Name: TEST
Location: \TEST.dbs
Description: Service generates hospitalisation&
Default Namespace: https://bur.TEST.ru/dss/services/tfoms
Current Request Name: get_single_inserted_branch_by_id
Current Params: {clinicID=}
Nested Exception:-
java.lang.NumberFormatException: For input string: ""
On WSO2 DSS it works good and it takes info from postgres.
Here is a code of proxy servise from WSO2 ESB:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="BurProxy"
transports="http,https"
statistics="disable"
trace="enable"
startOnLoad="true">
<target>
<inSequence>
<property name="CLINIC_ID"
expression="//clinicID/text()"
scope="axis2"
type="STRING"/>
<log level="full">
<property name="CLINIC_ID" expression="clinicID"/>
</log>
<payloadFactory media-type="xml">
<format>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tfom="https://bur.cdmarf.ru/dss/services/tfoms">
<soapenv:Header/>
<soapenv:Body>
<tfom:get_single_inserted_branch_by_id>
<tfom:clinicID>$1</tfom:clinicID>
</tfom:get_single_inserted_branch_by_id>
</soapenv:Body>
</soapenv:Envelope>
</format>
<args>
<arg evaluator="xml" expression="$axis2:CLINIC_ID"/>
</args>
</payloadFactory>
<log>
<property name="PAYLOAD" expression="$body"/>
</log>
<call blocking="true">
<endpoint key="dss"/>
</call>
<xslt key="xslt-remove-namespace"/>
<property name="messageType" value="text/xml" scope="axis2"/>
<property name="contentType" value="text/xml" scope="axis2"/>
<property name="rabbitmq.attributes.app.id"
value="RMIS"
scope="axis2"
type="STRING"/>
<property name="rabbitmq.attributes.type"
value="BRANCH"
scope="axis2"
type="STRING"/>
<property name="rabbitmq.attributes.user.id"
value="rmis"
scope="axis2"
type="STRING"/>
<property name="MESSAGE_ID" expression="get-property('MessageID')"/>
<script language="js">var messageID = mc.getProperty('MESSAGE_ID').substring(9,45);
mc.setProperty("RABBIT_MESSAGE_ID", messageID);</script>
<property name="rabbitmq.attributes.custom.message.id"
expression="get-property('RABBIT_MESSAGE_ID')"
scope="axis2"/>
<clone continueParent="true">
<target sequence="writeToFile"/>
</clone>
<send>
<endpoint key="rabbit"/>
</send>
<payloadFactory media-type="xml">
<format>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tfom="https://bur.cdmarf.ru/dss/services/tfoms">
<soapenv:Header/>
<soapenv:Body>
<tfom:get_inserted_divisions_of_clinic>
<tfom:clinicID>$1</tfom:clinicID>
</tfom:get_inserted_divisions_of_clinic>
</soapenv:Body>
</soapenv:Envelope>
</format>
<args>
<arg evaluator="xml" expression="$axis2:CLINIC_ID"/>
</args>
</payloadFactory>
<call blocking="true">
<endpoint key="dss"/>
</call>
<iterate xmlns:tfoms="https://bur.cdmarf.ru/dss/services/tfoms"
continueParent="true"
expression="//tfoms:DIVISION"
sequential="true">
<target>
<sequence>
<property name="rabbitmq.attributes.type"
value="DIVISION"
scope="axis2"
type="STRING"/>
<property name="messageType" value="xml" scope="axis2"/>
<property name="contentType" value="xml" scope="axis2"/>
<property name="MESSAGE_ID" expression="get-property('MessageID')"/>
<script language="js">var messageID = mc.getProperty('MESSAGE_ID').substring(9,45);
mc.setProperty("RABBIT_MESSAGE_ID", messageID);</script>
<property name="rabbitmq.attributes.custom.message.id"
expression="get-property('RABBIT_MESSAGE_ID')"
scope="axis2"/>
<xslt key="xslt-remove-namespace"/>
<clone continueParent="true">
<target sequence="writeToFile"/>
</clone>
<send>
<endpoint key="rabbit"/>
</send>
</sequence>
</target>
</iterate>
<payloadFactory media-type="xml">
<format>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tfom="https://bur.cdmarf.ru/dss/services/tfoms">
<soapenv:Body>
<tfom:get_inserted_liks_division_to_bed>
<tfom:clinicID>$1</tfom:clinicID>
</tfom:get_inserted_liks_division_to_bed>
</soapenv:Body>
</soapenv:Envelope>
</format>
<args>
<arg evaluator="xml" expression="$axis2:CLINIC_ID"/>
</args>
</payloadFactory>
<call blocking="true">
<endpoint key="dss"/>
</call>
<iterate xmlns:tfoms="https://bur.cdmarf.ru/dss/services/tfoms"
continueParent="true"
expression="//tfoms:DIVISION_LINK_STRUCTURE_BED"
sequential="true">
<target>
<sequence>
<property name="rabbitmq.attributes.type"
value="DIVISION_LINK_STRUCTURE_BED"
scope="axis2"
type="STRING"/>
<property name="messageType" value="xml" scope="axis2"/>
<property name="contentType" value="xml" scope="axis2"/>
<property name="MESSAGE_ID" expression="get-property('MessageID')"/>
<script language="js">var messageID = mc.getProperty('MESSAGE_ID').substring(9,45);
mc.setProperty("RABBIT_MESSAGE_ID", messageID);</script>
<property name="rabbitmq.attributes.custom.message.id"
expression="get-property('RABBIT_MESSAGE_ID')"
scope="axis2"/>
<xslt key="xslt-remove-namespace"/>
<clone continueParent="true">
<target sequence="writeToFile"/>
</clone>
<send>
<endpoint key="rabbit"/>
</send>
</sequence>
</target>
</iterate>
<payloadFactory media-type="xml">
<format>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tfom="https://bur.cdmarf.ru/dss/services/tfoms">
<soapenv:Body>
<tfom:get_inserted_amound_bed>
<tfom:clinicID>$1</tfom:clinicID>
</tfom:get_inserted_amound_bed>
</soapenv:Body>
</soapenv:Envelope>
</format>
<args>
<arg evaluator="xml" expression="$axis2:CLINIC_ID"/>
</args>
</payloadFactory>
<call blocking="true">
<endpoint key="dss"/>
</call>
<iterate xmlns:tfoms="https://bur.cdmarf.ru/dss/services/tfoms"
continueParent="true"
expression="//tfoms:AMOUNT_BED"
sequential="true">
<target>
<sequence>
<property name="rabbitmq.attributes.type"
value="AMOUNT_BED"
scope="axis2"
type="STRING"/>
<property name="messageType" value="xml" scope="axis2"/>
<property name="contentType" value="xml" scope="axis2"/>
<property name="MESSAGE_ID" expression="get-property('MessageID')"/>
<script language="js">var messageID = mc.getProperty('MESSAGE_ID').substring(9,45);
mc.setProperty("RABBIT_MESSAGE_ID", messageID);</script>
<property name="rabbitmq.attributes.custom.message.id"
expression="get-property('RABBIT_MESSAGE_ID')"
scope="axis2"/>
<xslt key="xslt-remove-namespace"/>
<clone continueParent="true">
<target sequence="writeToFile"/>
</clone>
<send>
<endpoint key="rabbit"/>
</send>
</sequence>
</target>
</iterate>
<respond/>
</inSequence>
</target>
<description/>
</proxy>
For a request like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tfom="bur.cdmarf.ru/dss/services/tfoms">
<soapenv:Header/>
<soapenv:Body>
<tfom:get_inserted_amound_bed>
<tfom:clinicID>6048820</tfom:clinicID>
</tfom:get_inserted_amound_bed>
</soapenv:Body>
</soapenv:Envelope>
Yo can use this mediators to capture and log the clinic_id value:
<property name="CLINIC_ID" xmlns:tfom="bur.cdmarf.ru/dss/services/tfoms"
expression="//tfom:get_inserted_amound_bed/tfom:clinicID"
scope="default"
type="STRING"/>
<log level="custom">
<property name="CLINIC_ID_PROPERTY_VALUE" expression="get-property('CLINIC_ID')"/>
</log>
<log>
<property name="PAYLOAD" expression="$body"/>
</log>
In the payload factory mediator use the same expression to capture the clinic id value:
<args>
<arg evaluator="xml" expression="get-property('CLINIC_ID')"/>
</args>

WSO2 ESB "Send" mediator not sending to Out Sequence of Proxy

I am having a slight issue with 2 sequence's I have created in a WSO2 Esb proxy service.
Here is my configuration:
My Proxy (Pepkor_Product_Search_Proxy) needs to search a web service and data service for product information and bring back the response(aggregated if need be).
My Proxy service calls 2 services ; a data service hosted on the DSS and a Web service hosted on the AS. The proxy request is sent to 2 "request sequences" that format the request to match the expected messages of the respective service calls on the AS and DSS. Once the responses are received , I send them to the 2 "response sequences" in order to format them according(in line with the WSDL) to the proxy service response. However once reaching the send mediators in these sequences , execution stops and they are not received by the Out Sequence of the proxy.
The send mediators are using the default behavior( which should be to send to out sequence of proxy) such as :
All 4 sequences( 2 Rq + 2Rs ) are dynamic and saved in system_/conf: registry
I recieve the message back in soap from only the one service ( it seems the rs sequences are responding and not the out seq of proxy!)
I want to know how I can get these "mediated" responses back into my proxies out sequence...
I have tried the sequence mediator instead of clone but to no avail.
Please see below : the Rq mssg , the proxy and "response" sequences synapse configurations as well as the proxy carbon log.
Thanks in advance and is there any other info you need let me know.
SOAP Rq:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:prod="http://za.co.pepkor/product_service/">
<soapenv:Header/>
<soapenv:Body>
<prod:productSearchReq>
<!--Optional:-->
<productName>NIKE_SHIRTS</productName>
<!--Optional:-->
<productSize>7</productSize>
<!--Optional:-->
<productColour>RED</productColour>
</prod:productSearchReq>
</soapenv:Body>
</soapenv:Envelope>
Proxy:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse" name="Pepkor_Product_Search_Proxy"
transports="https http" startOnLoad="true" trace="disable">
<target>
<inSequence>
<log level="custom">
<property name="Sending request to :"
value="ackServiceSearchSeqRq and shcServiceSearchSeqRq sequences..." />
</log>
<clone sequential="true">
<target sequence="conf:/ackServiceSearchSeqRq" />
<target sequence="conf:/shcServiceSearchSeqRq" />
</clone>
</inSequence>
<outSequence>
<log level="custom">
<property name="Out Sequence reached"
value="++++++++++++++=========Aggregating now========+++++++++++++++++==" />
</log>
<aggregate>
<completeCondition>
<messageCount min="-1" max="-1" />
</completeCondition>
<onComplete expression="//productDetails">
<log level="custom" separator=",">
<property name="::::"
value="======================= Sending Back the Aggregated Responses. ===============" />
</log>
</onComplete>
</aggregate>
<respond />
</outSequence>
<faultSequence />
</target>
<publishWSDL key="gov:service_integration/wsdls/PepKorProductSearch.wsdl" />
</proxy>
Ack Service Rs Sequence
<?xml version="1.0" encoding="UTF-8"?>
<sequence xmlns="http://ws.apache.org/ns/synapse" name="ackServiceSearchSeqRs">
<log level="custom">
<property name="Below Response recieved from Ack-WS" value="==================" />
</log>
<log level="full" />
<property xmlns:ns1="http://ack.pepkor.org" xmlns:ns="http://org.apache.synapse/xsd"
xmlns:ax23="http://ack.pepkor.org/xsd" name="product_Colour"
expression="//ns1:productSearchResponse/ns1:return/ax23:product_Colour/text()"
scope="default" type="STRING" />
<log level="custom">
<property xmlns:ns="http://org.apache.synapse/xsd" name="ackRs:Colour : "
expression="$ctx:product_Colour" />
</log>
<property xmlns:ns1="http://ack.pepkor.org" xmlns:ns="http://org.apache.synapse/xsd"
xmlns:ax23="http://ack.pepkor.org/xsd" name="product_ID"
expression="//ns1:productSearchResponse/ns1:return/ax23:product_ID/text()"
scope="default" type="STRING" />
<log level="custom">
<property xmlns:ns="http://org.apache.synapse/xsd" name="ackRs:ID : "
expression="$ctx:product_ID" />
</log>
<property xmlns:ns1="http://ack.pepkor.org" xmlns:ns="http://org.apache.synapse/xsd"
xmlns:ax23="http://ack.pepkor.org/xsd" name="product_Name"
expression="//ns1:productSearchResponse/ns1:return/ax23:product_Name/text()"
scope="default" type="STRING" />
<log level="custom">
<property xmlns:ns="http://org.apache.synapse/xsd" name="ackRs:Name : "
expression="$ctx:product_Name" />
</log>
<property xmlns:ns1="http://ack.pepkor.org" xmlns:ns="http://org.apache.synapse/xsd"
xmlns:ax23="http://ack.pepkor.org/xsd" name="product_Size"
expression="//ns1:productSearchResponse/ns1:return/ax23:product_Size/text()"
scope="default" type="STRING" />
<log level="custom">
<property xmlns:ns="http://org.apache.synapse/xsd" name="ackRs:Size : "
expression="$ctx:product_Size" />
</log>
<property xmlns:ns1="http://ack.pepkor.org" xmlns:ns="http://org.apache.synapse/xsd"
xmlns:ax23="http://ack.pepkor.org/xsd" name="source"
expression="//ns1:productSearchResponse/ns1:return/ax23:source/text()"
scope="default" type="STRING" />
<log level="custom">
<property xmlns:ns="http://org.apache.synapse/xsd" name="ackRs:Source : "
expression="$ctx:source" />
</log>
<property xmlns:ns1="http://ack.pepkor.org" xmlns:ns="http://org.apache.synapse/xsd"
xmlns:ax23="http://ack.pepkor.org/xsd" name="type"
expression="//ns1:productSearchResponse/ns1:return/ax23:type/text()"
scope="default" type="STRING" />
<log level="custom">
<property xmlns:ns="http://org.apache.synapse/xsd" name="ackRs:Type : "
expression="$ctx:type" />
</log>
<payloadFactory media-type="xml">
<format>
<productDetails xmlns:pep="http://za.co.pepkor/product_service/">
<productID>$1</productID>
<productName>$2</productName>
<productSize>$3</productSize>
<productColour>$4</productColour>
<productType>$5</productType>
<sourceID>$6</sourceID>
</productDetails>
</format>
<args>
<arg xmlns:ns="http://org.apache.synapse/xsd" evaluator="xml"
expression="$ctx:product_ID" />
<arg xmlns:ns="http://org.apache.synapse/xsd" evaluator="xml"
expression="$ctx:product_Name" />
<arg xmlns:ns="http://org.apache.synapse/xsd" evaluator="xml"
expression="$ctx:product_Size" />
<arg xmlns:ns="http://org.apache.synapse/xsd" evaluator="xml"
expression="$ctx:product_Colour" />
<arg xmlns:ns="http://org.apache.synapse/xsd" evaluator="xml"
expression="$ctx:type" />
<arg xmlns:ns="http://org.apache.synapse/xsd" evaluator="xml"
expression="$ctx:source" />
</args>
</payloadFactory>
<send />
</sequence>
Shc Service Rs Sequence
<?xml version="1.0" encoding="UTF-8"?>
<sequence xmlns="http://ws.apache.org/ns/synapse" name="shcServiceSearchSeqRs">
<log level="custom">
<property name="Below response recieved from Shc-DS" value="==================" />
</log>
<log level="full" />
<property xmlns:ns1="SHC" xmlns:ns="http://org.apache.synapse/xsd"
name="Product_ID" expression="//ns1:productDetails/ns1:Product_ID/text()"
scope="default" type="STRING" />
<log level="custom">
<property xmlns:ns="http://org.apache.synapse/xsd" name="shcRs: Product_ID : "
expression="$ctx:Product_ID" />
</log>
<property xmlns:ns1="SHC" xmlns:ns="http://org.apache.synapse/xsd"
name="Product_Name" expression="//ns1:productDetails/ns1:Product_Name/text()"
scope="default" type="STRING" />
<log level="custom">
<property xmlns:ns="http://org.apache.synapse/xsd" name="shcRs: Product_Name : "
expression="$ctx:Product_Name" />
</log>
<property xmlns:ns1="SHC" xmlns:ns="http://org.apache.synapse/xsd"
name="Product_Size" expression="//ns1:productDetails/ns1:Product_Size/text()"
scope="default" type="STRING" />
<log level="custom">
<property xmlns:ns="http://org.apache.synapse/xsd" name="shcRs: Product_Size : "
expression="$ctx:Product_Size" />
</log>
<property xmlns:ns1="SHC" xmlns:ns="http://org.apache.synapse/xsd"
name="Product_Colour" expression="//ns1:productDetails/ns1:Product_Colour/text()"
scope="default" type="STRING" />
<log level="custom">
<property xmlns:ns="http://org.apache.synapse/xsd" name="shcRs: Product_Colour : "
expression="$ctx:Product_Colour" />
</log>
<property xmlns:ns1="SHC" xmlns:ns="http://org.apache.synapse/xsd"
name="Product_Type" expression="//ns1:productDetails/ns1:Product_Type/text()"
scope="default" type="STRING" />
<log level="custom">
<property xmlns:ns="http://org.apache.synapse/xsd" name="shcRs: Product_Type : "
expression="$ctx:Product_Type" />
</log>
<property xmlns:ns1="SHC" xmlns:ns="http://org.apache.synapse/xsd"
name="Source" expression="//ns1:productDetails/ns1:Source/text()"
scope="default" type="STRING" />
<log level="custom">
<property xmlns:ns="http://org.apache.synapse/xsd" name="shcRs: Source : "
expression="$ctx:Source" />
</log>
<payloadFactory media-type="xml">
<format>
<productDetails xmlns="">
<productID>$1</productID>
<productName>$2</productName>
<productSize>$3</productSize>
<productColour>$4</productColour>
<productType>$5</productType>
<sourceID>$6</sourceID>
</productDetails>
</format>
<args>
<arg xmlns:ns="http://org.apache.synapse/xsd" evaluator="xml"
expression="$ctx:Product_ID" />
<arg xmlns:ns="http://org.apache.synapse/xsd" evaluator="xml"
expression="$ctx:Product_Name" />
<arg xmlns:ns="http://org.apache.synapse/xsd" evaluator="xml"
expression="$ctx:Product_Size" />
<arg xmlns:ns="http://org.apache.synapse/xsd" evaluator="xml"
expression="$ctx:Product_Colour" />
<arg xmlns:ns="http://org.apache.synapse/xsd" evaluator="xml"
expression="$ctx:Product_Type" />
<arg xmlns:ns="http://org.apache.synapse/xsd" evaluator="xml"
expression="$ctx:Source" />
</args>
</payloadFactory>
<send />
</sequence>
SOAP Rs
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<productDetails>
<productID>214562</productID>
<productName>NIKE_SHIRTS</productName>
<productSize>7</productSize>
<productColour>RED</productColour>
<productType>SHIRT</productType>
<sourceID>SHC</sourceID>
</productDetails>
</soapenv:Body>
</soapenv:Envelope>
WSO2 Carbon Log
https : // docs. google. com/document/d/12At0zir99H9cOo9hzNrgG33r52PHF0W32XLyBT6dzUQ/edit? usp=sharing
Edit
My AggHandlerSequence :
<sequence xmlns="http://ws.apache.org/ns/synapse">
<log level="custom">
<property name="pocSearchRsHandlerSeq reached" value="++++++++++++++=========Aggregating now========+++++++++++++++++=="></property>
</log>
<aggregate>
<completeCondition>
<messageCount min="-1" max="-1"></messageCount>
</completeCondition>
<onComplete xmlns:ns="http://org.apache.synapse/xsd" xmlns:prod="http://za.co.pepkor/product_service/" expression="//prod:productSearchResp/productDetails">
<log level="custom" separator=",">
<property name="::::" value="======================= Sending Back the Aggregated Responses. ==============="></property>
</log>
<respond></respond>
</onComplete>
</aggregate>
</sequence>
And one of my Rs Seq
<sequence xmlns="http://ws.apache.org/ns/synapse">
:
:
<payloadFactory media-type="xml">
<format>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:prod="http://za.co.pepkor/product_service/">
<soapenv:Body>
<prod:productSearchResp>
<productDetails xmlns="">
<productID>$1</productID>
<productName>$2</productName>
<productSize>$3</productSize>
<productColour>$4</productColour>
<productType>$5</productType>
<sourceID>$6</sourceID>
</productDetails>
</prod:productSearchResp>
</soapenv:Body>
</soapenv:Envelope>
:
:
<sequence key="conf:/pocSearchRsHandlerSeq"></sequence>
:
:
But am getting this Rs in soap
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<productDetails>
<productID>2145627</productID>
<productName>NIKE_SHIRTS</productName>
<productSize>7</productSize>
<productColour>RED</productColour>
<productType>SHIRT</productType>
<sourceID>ACK</sourceID>
</productDetails>
<productDetails>
<productID>214562</productID>
<productName>NIKE_SHIRTS</productName>
<productSize>7</productSize>
<productColour>RED</productColour>
<productType>SHIRT</productType>
<sourceID>SHC</sourceID>
</productDetails>
</soapenv:Body>
</soapenv:Envelope>
I however want a response similar to the Payload factory in the Rs seq , have tried playing with the corrolateOn expression. Can I store these aggregated fields as properties and use them in a payload factory or how do I map the Agg responses to ?
Final edit
Got it perfect here's a Rs seq payload:(this will be recieved by agg handler)
<productDetails xmlns="">
<productID>$1</productID>
<productName>$2</productName>
<productSize>$3</productSize>
<productColour>$4</productColour>
<productType>$5</productType>
<sourceID>$6</sourceID>
</productDetails>
And my full agg handler :
<sequence xmlns="http://ws.apache.org/ns/synapse">
<log level="custom">
<property name="pocSearchRsHandlerSeq reached" value="++++++++++++++=========Aggregating now========+++++++++++++++++=="></property>
</log>
<aggregate>
<completeCondition>
<messageCount min="-1" max="-1"></messageCount>
</completeCondition>
<onComplete xmlns:ns="http://org.apache.synapse/xsd" expression="//productDetails">
<log level="custom" separator=",">
<property name="::::" value="======================= Formatting the Aggregated Responses. ==============="></property>
</log>
<log level="full"></log>
<payloadFactory media-type="xml">
<format>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:prod="http://za.co.pepkor/product_service/">
<soapenv:Body>
<prod:productSearchResp> $1 </prod:productSearchResp>
</soapenv:Body>
</soapenv:Envelope>
</format>
<args>
<arg expression="//productDetails" evaluator="xml"></arg>
</args>
</payloadFactory>
<respond></respond>
</onComplete>
</aggregate>
</sequence>
If you want to use aggregate mediator, the 2 responses must be go to the same sequence in which you use this mediator
In your proxy inSequence, you use clone and call "ackServiceSearchSeqRq" and "shcServiceSearchSeqRq" as you already do
In each of theses request seq, you format your request according to the service you want to call and then use send mediator from one of these ways :
1st Option : <send> <endpoint key="xxx"> </send> : the 2 responses from your 2 services will go to your proxy's outSequence
2nd Option : <send receive="MyAggregateSequence"> <endpoint key="xxx"> </send> : the 2 responses from your 2 services will go to "MyAggregateSequence"
In your proxy's outSequence or in "MyAggregateSequence", depending on the option you have chosen, you use filter or switch mediator to determine if it is a response from ackService or from shcService and decide which transformation to apply (pay attention to the productDetails node you create with payloadFactory, if there is no namespace then specify xmlns="" each time : this is not the case in your samples) before calling aggregate mediator. Inside aggregate/onComplete, you can use send mediator with no endpoint to send back your aggregated message to the proxy's caller.
In your case, there is 2 <send/>, one in each of your 2 Rs sequence : the 1st one is sent to the proxy's caller and the 2nd one does nothing (the ESB must says than you try to respond 2 times).
When using the clone mediator and you want to collect the response of the two messages, you must set and id on the clone mediator and using the same id in the aggregator mediator.
< clone id="XXX">
< aggregate id="XXX">
This way the aggregator knows to which calls it needs to wait for.

Wso2esb Transaction for local Database

I am really worrying about this future.If your developing some product like middleware you should aware of all the future like transaction,sec,.etc
security is good in wso2 where as transactions are really poor
i am using wso2esb4.8.0 and wso2dss3.0.1 .I wish to insert the data into my 2 tables simple logic if my 2nd table went wrong my first table also roll backed.For this i used wso2dss Box-carring future and its perfectly fine while i am doing from wso2dss try-it .BUt same future i wish to incorporate with wso2esb .i call 4 operation like beginboxcarring,insertintot1,insertintot2,endboxcarring but its not working in this then i got sloution with get JSESSIONID which will create when call a beginboxcarring but there is no use i tried with this properties to get JSESSIONID
and my proxy is
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="TransactionProxy"
transports="https,http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<log level="full">
<property name="M1" value="*************HITTING Transaction PROXY*************"/>
</log>
<property name="OUT_ONLY" value="true"/>
<property name="companycode" expression="//companycode/text()"/>
<property name="companyname" expression="//companyname/text()"/>
<property name="clientcode" expression="//clientcode/text()"/>
<property name="clientname" expression="//clientname/text()"/>
<property name="session type"
value="JSESSIONID"
scope="default"
type="STRING"/>
<payloadFactory media-type="xml">
<format>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:dat="http://ws.wso2.org/dataservice">
<soapenv:Header/>
<soapenv:Body/>
</soapenv:Envelope>
</format>
<args/>
</payloadFactory>
<log level="full">
<property name="M2" value="*************HITTING Transaction PROXY*************"/>
</log>
<header name="Action" value="urn:begin_boxcar"/>
<property name="setCookieHeader"
expression="$trp:Set-Cookie"
scope="default"
type="STRING"/>
<callout serviceURL="http://localhosttt:9764/services/Transaction/begin_boxcar"
action="urn:begin_boxcar">
<source type="envelope"/>
<target xmlns:s12="http://www.w3.org/2003/05/soap-envelope"
xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/"
xpath="s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]"/>
</callout>
<property name="setCookieHeader"
expression="$trp:Set-Cookie"
scope="default"
type="STRING"/>
<log level="full">
<property name="JSESSIONID" expression="get-property('setCookieHeader')"/>
</log>
<payloadFactory media-type="xml">
<format>
<p:insertinto_mclient_OP xmlns:p="http://ws.wso2.org/dataservice">
<xs:clientcode xmlns:xs="http://ws.wso2.org/dataservice">$1</xs:clientcode>
<xs:clientname xmlns:xs="http://ws.wso2.org/dataservice">$2</xs:clientname>
<xs:createdbyid xmlns:xs="http://ws.wso2.org/dataservice">-1</xs:createdbyid>
<xs:modifiedbyid xmlns:xs="http://ws.wso2.org/dataservice">-1</xs:modifiedbyid>
</p:insertinto_mclient_OP>
</format>
<args>
<arg evaluator="xml" expression="get-property('clientcode')"/>
<arg evaluator="xml" expression="get-property('clientname')"/>
</args>
</payloadFactory>
<header name="Action" value="urn:insertinto_mclient_OP"/>
<callout serviceURL="http://localhosttt:9764/services/Transaction/"
action="urn:insertinto_mclient_OP">
<source xmlns:s12="http://www.w3.org/2003/05/soap-envelope"
xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/"
xpath="s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]"/>
<target xmlns:s12="http://www.w3.org/2003/05/soap-envelope"
xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/"
xpath="s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]"/>
</callout>
<payloadFactory media-type="xml">
<format>
<p:insertinto_mcompany_OP xmlns:p="http://ws.wso2.org/dataservice">
<xs:companycode xmlns:xs="http://ws.wso2.org/dataservice">$1</xs:companycode>
<xs:comapnyname xmlns:xs="http://ws.wso2.org/dataservice">$2</xs:comapnyname>
<xs:createdbyid xmlns:xs="http://ws.wso2.org/dataservice">-1</xs:createdbyid>
<xs:modifiedbyid xmlns:xs="http://ws.wso2.org/dataservice">-1</xs:modifiedbyid>
<xs:clientid xmlns:xs="http://ws.wso2.org/dataservice">-1</xs:clientid>
</p:insertinto_mcompany_OP>
</format>
<args>
<arg evaluator="xml" expression="get-property('companycode')"/>
<arg evaluator="xml" expression="get-property('companyname')"/>
</args>
</payloadFactory>
<log level="full">
<property name="M5" value="**************hitting2nd dss*****"/>
</log>
<header name="Action" value="urn:insertinto_mcompany_OP"/>
<callout serviceURL="http://localhosttt:9764/services/Transaction/"
action="urn:insertinto_mcompany_OP">
<source xmlns:s12="http://www.w3.org/2003/05/soap-envelope"
xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/"
xpath="s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]"/>
<target xmlns:s12="http://www.w3.org/2003/05/soap-envelope"
xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/"
xpath="s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]"/>
</callout>
<payloadFactory media-type="xml">
<format>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:dat="http://ws.wso2.org/dataservice">
<soapenv:Header/>
<soapenv:Body/>
</soapenv:Envelope>
</format>
<args/>
</payloadFactory>
<log level="full">
<property name="M3" value="*************HITTING Transaction PROXY*************"/>
</log>
<header name="Action" value="urn:end_boxcar"/>
<callout serviceURL="http://localhosttt:9764/services/Transaction/end_boxcar"
action="urn:end_boxcar">
<source type="envelope"/>
<target xmlns:s12="http://www.w3.org/2003/05/soap-envelope"
xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/"
xpath="s11:Body/child::*[fn:position()=1] | s12:Body/child::*[fn:position()=1]"/>
</callout>
<log level="full">
<property name="M4" value="*************HITTING Transaction PROXY*************"/>
</log>
</inSequence>
<outSequence>
<send/>
</outSequence>
</target>
<description/>
</proxy>
but log is showing JSESSIONID=null
and even i tried this properties also no change in log
<property name="setCookieHeader"
expression="get-property('transport','Set-Cookie')"
scope="default"
type="STRING"/>
<property name="setCookieHeader5"
expression="get-property('transport','JSESSIONID')"
scope="default"
type="STRING"/>
how would i get if i call from CURL the dss operation begin_boxcarring end point giving like this in header
Set-Cookie: JSESSIONID=6776AC50E31EBFC456CDA1895ACDE0B8; Path=/; HttpOnly
but unable to get into synapse how would i get .is there any option for transaction really worried about this future in wso2