<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/
name="logTestProxy"
startOnLoad="true"
statistics="disable"
trace="disable"
transports="http,https">
<target>
<inSequence>
<payloadFactory media-type="json">
<format>
{
"entry": [
{
"resource": {
"id": 111111,
"address": {
"type": "postal",
"line": [
33333,
99999
],
"city": "AAAAA",
"state": "TX",
"postalCode": 1223,
"country": "US"
}
},
{
"resource": {
"id": 222222,
"address": {
"type": "postal",
"line": [
"amalka33333",
"amalka99999"
],
"city": "CCCCC",
"state": "TX",
"postalCode": 345433,
"country": "US"
}
},
{
"resource": {
"id": 342423424
}
]
}
</format>
<args/>
</payloadFactory>
<script language="js">
var payload = mc.getPayloadJSON();
var log = mc.getServiceLog();
for (i = 0; i < payload.entry.length; ++i) {
if(payload.entry[i].resource.hasOwnProperty('address')) {
if(payload.entry[i].resource.address.hasOwnProperty('line')) {
var lineArray = payload.entry[i].resource.address.line;
payload.entry[i].resource.address.line=lineArray.join().split(',');
}
}
}
mc.setPayloadJSON(payload);
</script>
<property name="messageType"
scope="axis2"
type="STRING"
value="application/json"/>
<respond/>
</inSequence>
<outSequence/>
</target>
<description/>
</proxy>
"entry": [
{
"resource": {
"id": 111111,
"address": {
"type": "postal",
"line": [
"33333",
"99999"
],
"city": "AAAAA",
"state": "TX",
"postalCode": 1223,
"country": "US"
}
},
{
"resource": {
"id": 222222,
"address": {
"type": "postal",
"line": [
"amalka33333",
"amalka99999"
],
"city": "CCCCC",
"state": "TX",
"postalCode": 345433,
"country": "US"
}
},
{
"resource": {
"id": 342423424
}
]
}
Comments