Actually I'm trying to get an empty value when I set a Property in a sequence in WSO2 ESB with an empty string. I have tried many things but always get the result "null" or "\"\"" instead of "" when I get the property, here is my code:
<property value=""""
name="arq.general.DestinationSystem" scope="default"
type="STRING" xmlns:ns="http://org.apache.synapse/xsd"
xmlns:ns2="http://org.apache.synapse/xsd"/>
<property name="arq.general.ParentInstanceID" scope="default"
type="STRING" value=""/>
<property expression="get-property('NonExistentProperty')"
name="arq.functional.User"
scope="default" type="STRING"
xmlns:ns="http://org.apache.synapse/xsd"
xmlns:ns2="http://org.apache.synapse/xsd"/>
Please could you help?
Cheers,
Tony
++ the payload Factory:
<payloadFactory media-type="xml">
<format>
<MensajeAuditoria xmlns="">
<Timestamp>$1</Timestamp>
<TrackingID>$2</TrackingID>
<SourceApplication>$3</SourceApplication>
<OperationName>$4</OperationName>
<ParentInstanceID>$5</ParentInstanceID>
<InstanceID>$6</InstanceID>
<ServiceID>$7</ServiceID>
<FunctionalID>$8</FunctionalID>
<AdapterType>$9</AdapterType>
<AdapterPoint>$10</AdapterPoint>
<HostName>$11</HostName>
<User>$12</User>
</MensajeAuditoria>
</format>
<args>
<arg evaluator="xml" expression="get-property('SYSTEM_TIME')"/>
<arg evaluator="xml" expression="get-property('arq.general.TrackingID')"/>
<arg evaluator="xml" expression="get-property('arq.general.SourceApplication')"/>
<arg evaluator="xml" expression="get-property('arq.functional.OperationName')"/>
<arg evaluator="xml" expression="get-property('arq.general.ParentInstanceID')"/>
<arg evaluator="xml" expression="get-property('arq.general.InstanceID')"/>
<arg evaluator="xml" expression="get-property('arq.general.ServiceID')"/>
<arg evaluator="xml" expression="get-property('arq.functional.FunctionalID')"/>
<arg evaluator="xml" expression="get-property('arq.general.AdapterType')"/>
<arg evaluator="xml" expression="$func:AdapterPoint"/>
<arg evaluator="xml" expression="get-property('SERVER_IP')"/>
<arg evaluator="xml" expression="get-property('arq.functional.User')"/>
</args>
</payloadFactory>
</else>
</filter>
<property name="messageType" scope="axis2" type="STRING" value="application/json"/>
Adding the factory result:
{
"MensajeAuditoria": {
"Timestamp": 1492777451830,
"TrackingID": "76b9858d-8421-4d7e-d2af-e8e411382e2e",
"SourceApplication": "API Manager",
"OperationName": null,
"ParentInstanceID": null,
"InstanceID": "76b9858d-8421-4d7e-d2af-e8e411382e2e",
"ServiceID": "PRX_PROY1_AEX_AltaCliente",
"FunctionalID": null,
"AdapterType": "AEXP",
"AdapterPoint": "PreActRequest",
"HostName": "172.16.3.97",
"User": null,
}}