Extracting binary as base64 String results in incomplete file? - wso2

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

Related

WSO2 EI: empty fields ("") are added as null in the payload transformation

I'm retrieving some data's from DSS by using select query and then some transformation by payload factory after that I'm passing it to an endpoint, but when I do that the empty fields are being passed as null and not as empty strings ""
"department":"{department":null}",
"Selling_dealer__c":"{Selling_dealer__c":null}"
I wish it really showed like this:
"department":"",
"Selling_dealer__c":""
Note: Also tried the synapse properties file method but not working as excepted refer link 1 refer link 2
<sequence name="LaravelConnectorSequence" xmlns="http://ws.apache.org/ns/synapse">
<payloadFactory media-type="json">
<format>
{
"screen_type": "opportunity",
"vehicle_type__c": "",
"description": "",
"audio_file_name__c": "$1",
"lead_type__c": "Phone",
"request_type__c": "",
"mobile__c": "$2",
"leadsource": "Novum",
"company__c": "N/A",
"location__c": "$3",
"department__c": "$4",
"selling_dealer__c":"$5"
}
</format>
<args>
<arg evaluator="xml"
expression="get-property('audioFileName')"
literal="false" xmlns:ns="http://org.apache.synapse/xsd"/>
<arg evaluator="xml" expression="get-property('mobile')"
literal="false" xmlns:ns="http://org.apache.synapse/xsd"/>
<arg evaluator="xml" expression="get-property('location')"
literal="false" xmlns:ns="http://org.apache.synapse/xsd"/>
<arg evaluator="xml" expression="get-property('department')"
literal="false" xmlns:ns="http://org.apache.synapse/xsd"/>
<arg evaluator="xml"
expression="get-property('selling_dealer__c')"
literal="false" xmlns:ns="http://org.apache.synapse/xsd"/>
</args>
</payloadFactory>
<log level="custom">
<property expression="json-eval($)"
name="=======Laravel Request====" xmlns:ns="http://org.apache.synapse/xsd"/>
</log>
<property expression="get-property('Novum-configs')" name="config"
scope="axis2" type="OM" xmlns:ns="http://org.apache.synapse/xsd"/>
<property expression="$axis2:config//*[local-name()='laravelToken']"
name="Authorization" scope="transport" type="STRING" xmlns:ns="http://org.apache.synapse/xsd"/>
<property expression="$axis2:config//*[local-name()='laravelURL']"
name="uri.var.laravelapi" scope="default" type="STRING" xmlns:ns="http://org.apache.synapse/xsd"/>
<call>
<endpoint>
<http method="POST" uri-template="{uri.var.laravelapi}"/>
</endpoint>
</call>
<log level="custom">
<property expression="json-eval($)"
name="=======Laravel Response====" xmlns:ns="http://org.apache.synapse/xsd"/>
</log>
Since you want to convert your null values into "" strings, one workaround would be to convert the JSON to XML and then extract the elements from that and add them to your final JSON payload. In WSO2 there are different options you can set when converting JSON payloads. You can read about different options and how to work with JSON messages from here.
Since you want null to be "". You need to set the following property. If you are on MI this needs to go into deployment.toml, if on EI this goes into synapse.properties
'synapse.commons.enableXmlNullForEmptyElement'=false
Note: In MI (Surround the property name with single quotes)
When you are extracting data from the DSS response make sure to use Xpath expressions instead of JSON path expressions. Following is a simplified version of your configurations. Note I have hardcoded the DSS response.
<?xml version="1.0" encoding="UTF-8"?>
<api context="/api" name="RESTApi" xmlns="http://ws.apache.org/ns/synapse">
<resource methods="GET" url-mapping="/sample">
<inSequence>
<payloadFactory media-type="json">
<format>{"Selling_dealer__c": null}</format>
<args/>
</payloadFactory>
<property expression="//Selling_dealer__c" name="logInJson" scope="default" type="STRING"/>
<payloadFactory media-type="json">
<format>
{
"screen_type": "opportunity",
"selling_dealer__c": "$1"
}
</format>
<args>
<arg evaluator="xml" expression="$ctx:logInJson"/>
</args>
</payloadFactory>
<property name="messageType" scope="axis2" type="STRING" value="application/json"/>
<respond/>
</inSequence>
<outSequence/>
<faultSequence/>
</resource>
</api>
Above will produce the following response.
{
"screen_type": "opportunity",
"selling_dealer__c": "{"Selling_dealer__c":""}"
}
I used the script mediator to overcome this issue.
<script language="js"><![CDATA[var log=mc.getServiceLog();
var dep = mc.getProperty('department').toString();
var sell = mc.getProperty('selling_dealer__c').toString();
//log.info("===DepartmentValue===: "+dep);
var deps = mc.getProperty('department').startsWith("<Department");
//log.info("++++++++++++++++++++TRUE VALUE++++++++++++++++++"+deps);
if(dep.startsWith("<Department"))
{
dep ="";
mc.setProperty('department',dep);
}
//log.info("===DepartmentValueAfter===: "+dep)
//log.info("===SellingDealerValue===: "+sell);
var sells = mc.getProperty('selling_dealer__c').startsWith("<selling_dealer__c");
//log.info("++++++++++++++++++++TRUE VALUE++++++++++++++++++"+sells);
if(sell.startsWith("<selling_dealer__c"))
{
sell ="";
mc.setProperty('selling_dealer__c',sell);
}
//log.info("===selling_dealer__cValueAfter===: "+sell)
]]></script>

Wso2 EI 7.1.0 response processing slow

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>

WSO2 Api Manager 3.2.0 How Expose a SOAP Service as a REST API

I Use this document but this is Don't work:
https://apim.docs.wso2.com/en/3.2.0/learn/tutorials/expose-a-soap-service-as-a-rest-api/
for example automatic create this mediator for input and it's not work :
<header description="SOAPAction" name="SOAPAction" scope="transport" value="http://tempuri.org/ILivePublisher/Candles"/>
<property name="REST_URL_POSTFIX" scope="axis2" action="remove"/>
<property expression="json-eval($.Candles.instrumentIsin)" name="req.var.Candles.instrumentIsin"/>
<property expression="json-eval($.Candles.interval.Interval)" name="req.var.Candles.interval.Interval"/>
<property expression="json-eval($.Candles.since)" name="req.var.Candles.since"/>
<property expression="json-eval($.Candles.to)" name="req.var.Candles.to"/>
<payloadFactory description="transform" media-type="xml">
<format>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:web="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<web:Candles xmlns:web="http://tempuri.org/">
<web:instrumentIsin>$1</web:instrumentIsin>
<web:interval>
<web:Interval>$2</web:Interval>
</web:interval>
<web:since>$3</web:since>
<web:to>$4</web:to>
</web:Candles>
</soapenv:Body>
</soapenv:Envelope>
</format>
<args>
<arg evaluator="xml" expression="get-property('req.var.Candles.instrumentIsin')"/>
<arg evaluator="xml" expression="get-property('req.var.Candles.interval.Interval')"/>
<arg evaluator="xml" expression="get-property('req.var.Candles.since')"/>
<arg evaluator="xml" expression="get-property('req.var.Candles.to')"/>
</args>
</payloadFactory>
<property description="messageProperty" name="messageType" scope="axis2" type="STRING" value="application/soap+xml"/>

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>

Iterate Mediator sends duplicate payload almost always

We are trying out a scenario where we want to iterate over a list of nodes and make a POST call to some service with each individual request payload. We are seeing the iterate mediator actually sends two elements in that call and
that causes issues on the API end.
I have a mock service deployed locally that returns response say :
<result>
<row>
<product_id>8351</product_id>
<event_key>17708</event_key>
<event_code>AEONBM</event_code>
<show_title>Some Show</show_title>
<venue_name>Eugene ONeill Theatre</venue_name>
<area>ORCHC</area>
<row>C</row>
<seat_num>103</seat_num>
<seat_increment>1</seat_increment>
<marketing_code>PREMIUM</marketing_code>
<Cost>352.0000</Cost>
</row>
<row>
<product_id>8351</product_id>
<event_key>17708</event_key>
<event_code>AEONBM</event_code>
<show_title>Some Show</show_title>
<venue_name>Eugene ONeill Theatre</venue_name>
<area>ORCHC</area>
<row>C</row>
<seat_num>104</seat_num>
<seat_increment>1</seat_increment>
<marketing_code>PREMIUM</marketing_code>
<Cost>352.0000</Cost>
</row
</result>
Here is how my proxy service looks like:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="CreateListingFromGetLocation"
transports="https,http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<log level="full">
<property name="text" value="Triggering getLocation API call.."/>
</log>
<send receive="createListingsFromGetLocationResponseSequence">
<endpoint>
<http method="get" uri-template="http://localhost:8989/GetLocation/"/>
</endpoint>
</send>
<property name="OUT_ONLY" value="true"/>
</inSequence>
<outSequence>
<send/>
</outSequence>
<faultSequence/>
</target>
<description/>
</proxy>
Here is my receiving sequence that is using the iterate mediator:
<sequence xmlns="http://ws.apache.org/ns/synapse" name="createListingsFromGetLocationResponseSequence">
<iterate xmlns:tem="http://tempuri.org" xmlns:ns="http://org.apache.synapse/xsd" expression="//result/row">
<target>
<sequence>
<log level="full">
<property name="LocationRow" value="Row element from GetLocationResponse"></property>
</log>
<payloadFactory media-type="xml">
<format>
<listing xmlns="">
<eventId>$1</eventId>
<eventDescription>$2</eventDescription>
<pricePerTicket>
<amount>$3</amount>
<currency>USD</currency>
</pricePerTicket>
<quantity>$4</quantity>
<section>$5</section>
<rows>$6</rows>
<seats>$7</seats>
<splitOption>NONE</splitOption>
</listing>
</format>
<args>
<arg expression="//event_key" evaluator="xml"></arg>
<arg expression="//show_title" evaluator="xml"></arg>
<arg expression="//Cost" evaluator="xml"></arg>
<arg expression="//seat_increment" evaluator="xml"></arg>
<arg expression="//area" evaluator="xml"></arg>
<arg expression="//row/row" evaluator="xml"></arg>
<arg expression="//seat_num" evaluator="xml"></arg>
</args>
</payloadFactory>
<log level="full">
<property name="ListingRequest" value="Listing request xml"></property>
</log>
<property name="Content-Type" value="application/xml" scope="transport" type="STRING"></property>
<property name="messageType" value="application/xml" scope="transport" type="STRING"></property>
<property name="TARGET_HOST" value="srwd30" scope="transport" type="STRING"></property>
<property name="HTTP_METHOD" value="POST" scope="transport" type="STRING"></property>
<send>
<endpoint>
<http format="pox" method="post" uri-template="http://www.srwd30.com/listings/v1/"></http>
</endpoint>
</send>
</sequence>
</target>
</iterate>
</sequence>
Firstly, I see that it is iterating over each xml node properly, here are some logs indicating that:
[2014-04-22 13:29:42,020] INFO - LogMediator To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:3bc14a33-3a7a-478e-bdbf-720f1ec855a5, Direction: response, LocationRow = Row element from GetLocationResponse, Envelope: <?xml version="1.0" encoding="utf-8
"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><row>
<product_id>8351</product_id>
<event_key>17708</event_key>
<event_code>AEONBM</event_code>
<show_title>Some Show</show_title>
<venue_name>Eugene ONeill Theatre</venue_name>
<area>ORCHC</area>
<row>D</row>
<seat_num>103</seat_num>
<seat_increment>1</seat_increment>
<marketing_code>PREMIUM</marketing_code>
<Cost>352.0000</Cost>
</row></soapenv:Body></soapenv:Envelope>
[2014-04-22 13:29:42,021] INFO - LogMediator To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:0e04ac15-a0bf-41a3-a7d7-80a1401d3efc, Direction: response, ListingRequest = Listing request xml, Envelope: <?xml version="1.0" encoding="utf-8"?><soapenv:En
velope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><listing><eventId>17708</eventId><eventDescription>Some Show</eventDescription><pricePerTicket><amount>352.0000</amount><currency>USD</currency></pricePerTicket><quantity>1</quantity><section>ORCHC</section><rows
>C</rows><seats>103</seats><splitOption>NONE</splitOption></listing></soapenv:Body></soapenv:Envelope>
But on my API I see that we are receiving duplicate or two root nodes:
Content-Type: application/xml
Headers: {cache-control=[no-cache], connection=[Keep-Alive],
content-type=[application/xml], host=[www.srwd30.com], http_method=[POST], messagetype=[application/xml], target_host=[srwd30], transfer-encoding=
[chunked], user-agent=[Synapse-PT-HttpComponents-NIO]}
Payload: <listing><eventId>17708</eventId><eventDescription>Some Show</eventDescription><pricePerTicket><amount>352.0000</amount><currency>USD</currenc
y></pricePerTicket><quantity>1</quantity><section>ORCHC</section><rows>C</rows><seats>103</seats><splitOption>NONE</splitOption></listing><listing><eventId>1770
8</eventId><eventDescription>Some Show</eventDescription><pricePerTicket><amount>352.0000</amount><currency>USD</currency></pricePerTicket><quantity>1<
/quantity><section>ORCHC</section><rows>D</rows><seats>104</seats><splitOption>NONE</splitOption></listing>
--------------------------------------
2014-04-22 19:01:51,468 [e14f#fbf/http://www.srwd30.com/listings/v1/] priority=WARN app_name=shared-stubhubjobs thread=http-0.0.0.0-
8080-8 location=AbstractJAXBProvider line=112 javax.xml.bind.UnmarshalException
- with linked exception:
[com.ctc.wstx.exc.WstxParsingException: Illegal to have multiple roots (start tag in epilog?).
at [row,col {unknown-source}]: [1,291]]
From the looks of it, iterator is sending two elements when I make that send call. Am i missing something or doing something wrong? How can make each call independent from other?
I got the issue resolved by adding a Action header using urn:test value for that header. I realized that this was causing that duplicate requests to be sent and sometimes only one request being sent even if the iterator has about 10 records.
<proxy name="PushInventory"
transports="https http"
startOnLoad="true"
trace="disable">
<description/>
<target>
<inSequence>
<log level="full">
<property name="STATUS"
value="+++++++++++++++++ Inside PushInventory Proxy Service ++++++++++++++++++"/>
</log>
<iterate xmlns:tem="http://tempuri.org"
xmlns:ns="http://org.apache.synapse/xsd"
id="pushInventoryIterator"
expression="//result/row"
sequential="true">
<target>
<sequence>
<payloadFactory media-type="xml">
<format>
<listing xmlns="">
<eventId>$1</eventId>
<eventDescription>$2</eventDescription>
<pricePerTicket>
<amount>$3</amount>
<currency>USD</currency>
</pricePerTicket>
<quantity>$4</quantity>
<section>$5</section>
<rows>$6</rows>
<seats>$7</seats>
<splitOption>NONE</splitOption>
</listing>
</format>
<args>
<arg evaluator="xml" expression="//event_key"/>
<arg evaluator="xml" expression="//show_title"/>
<arg evaluator="xml" expression="//Cost"/>
<arg evaluator="xml" expression="//seat_increment"/>
<arg evaluator="xml" expression="//area"/>
<arg evaluator="xml" expression="//row_desc"/>
<arg evaluator="xml" expression="//seat_num"/>
</args>
</payloadFactory>
<log level="full">
<property name="STATUS"
value="++++++++++++ Invoking Listing EndPoint ++++++++++++++"/>
</log>
<property name="Authorization"
value="Basic dafdsfadsfdsafdsfdsafdsafsdfadsf"
scope="transport"
type="STRING"/>
<property name="Content-Type"
value="application/xml"
scope="transport"
type="STRING"/>
<property name="messageType"
value="application/xml"
scope="axis2"
type="STRING"/>
<property name="HTTP_METHOD" value="POST" scope="transport" type="STRING"/>
<header name="Action" scope="default" value="urn:test"/>
<send>
<endpoint key="ListingEndPoint"/>
</send>
</sequence>
</target>
</iterate>
</inSequence>
<outSequence>
<log level="full">
<property name="STATUS"
value="+++++++++++++++++ Inside OutSequence of PushInventory ++++++++++++++++++"/>
</log>
<aggregate>
<completeCondition>
<messageCount min="10" max="10"/>
</completeCondition>
<onComplete xmlns:ns2="com.blah.blah" expression="//listing">
<log level="full" separator=",">
<property name="STATUS"
value="+++++++++++++++++ Aggregating responses back ++++++++++++++++++"/>
</log>
<enrich>
<source type="envelope" clone="true"/>
<target type="body"/>
</enrich>
<send/>
</onComplete>
</aggregate>
</outSequence>
</target>
</proxy>
You put your log before the iterator mediator and see what you're receiving from the endpoint. It may contain duplicate entries. Then within iterate you have another log mediator. Check for records are right.