WSO2 ESB XSLT Mediator creates temp files (never cleaned) - xslt

I use WSO2 ESB 4.5.1 on Windows.
My problem is that the temp folder WSO2_HOME/tmp is growing up and never cleaned.
I found out that the problem comes from the xslt mediator, everytime it transform a big xml file (~15kb) a new temp file is created.
Does anyone have an idea why these tmp files are not cleaned up?
Proxy:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse" name="input" transports="vfs" startOnLoad="true" trace="disable">
<parameter name="transport.PollInterval">5</parameter>
<parameter name="transport.vfs.FileURI">vfs:file://C:/WSO2/Test/From</parameter>
<parameter name="transport.vfs.FileNamePattern">.*[.].*</parameter>
<parameter name="transport.vfs.ContentType">application/xml</parameter>
<target faultSequence="errorSequence">
<inSequence>
<log level="full"/>
<property name="ClientApiNonBlocking" scope="axis2" action="remove"/>
<property name="OUT_ONLY" value="true"/>
<xslt key="avintis_xml_indent"/>
<property name="transport.vfs.ReplyFileName" expression="fn:concat('out_', $trp:FILE_NAME, '.xml')" scope="transport"/>
<send>
<endpoint>
<address uri="vfs:file://C:/WSO2/Test/To"/>
</endpoint>
</send>
</inSequence>
</target>
</proxy>
XSLT:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:avintis="http://www.avintis.com/esb"
xmlns:urn="urn:hl7-org:v2xml" version="2.0"
xmlns:payload="http://ws.apache.org/commons/ns/payload">
<xsl:output method="xml" encoding="UTF-8" indent="yes"/>
<xsl:template match="*|text()|#*">
<xsl:copy>
<xsl:apply-templates select="*|text()|#*"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
inputfile:
any xml file bigger than ~15kb

Seems temp files do not get cleaned up by the HouseKeeping Task. To clean them using the housekeeping task you can configure it in the Carbon.xml as shown below.
<WorkDirectory>${carbon.home}/tmp/work</WorkDirectory>
<HouseKeeping>
<AutoStart>true</AutoStart>
<Interval>10</Interval>
<MaxTempFileLifetime>30</MaxTempFileLifetime>
</HouseKeeping>

Related

WSO2 ESB From XML (multiple lines) to JSON (without wrappers)

I hope to find help here... Here is the particular case:
I get this XML from my Endpoint:
<Entries>
<Entry>
<Customer>1</Customer>
</Entry>
<Entry>
<Customer>2</Customer>
</Entry>
<Entries>
I can easily convert this XML to JSON by changing the Property messageType, which will result in:
{"Entries":{"Entry":[{"Customer": 1}, {"Customer": 2}]}}
Here is what I want to get, as a JSON result (without wrappers):
[{"Customer": 1}, {"Customer": 2}]
Is there someone who knows how?
Many thanks in advance!
I think you've to first manipulate your xml (maybe with an xslt mediator) to format it this way
<jsonArray>
<Customer>1</Customer>
<Customer>2</Customer>
</jsonArray>
Then I guess you'll get your expected output.
For instance the following xslt could do the job
<xsl:stylesheet exclude-result-prefixes="xsl" version="2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output encoding="utf-8" indent="yes" method="xml" omit-xml-declaration="yes"/>
<xsl:template match="/Entries">
<xsl:element name="jsonArray">
<xsl:copy-of select="./Entry/Customer" />
</xsl:element>
</xsl:template>
</xsl:stylesheet>
Thank you Anuruddha and Nicolas!
Your answers inspired me and I want to share what I did.
I have created this sequence, which I reuse with a Sequence mediator:
<sequence name="toJSON" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<property name="messageType" scope="axis2" type="STRING" value="application/json"/>
<property name="result" scope="default" type="STRING" expression="json-eval($.Entries.Entry)"/>
<payloadFactory media-type="json">
<format>$1</format>
<args>
<arg evaluator="xml" expression="$ctx:result"/>
</args>
</payloadFactory>
</sequence>
It works so well I even changed the sequence of all my Proxies, even those that returns only 1 result.
Many thanks for your lights!!

Runtime error on WSO2 ESB 5.0

I'm trying to use WS02 ESB 5.0 to call a web service every 15 seconds, so I have this task:
<?xml version="1.0" encoding="UTF-8"?>
<task class="org.apache.synapse.startup.tasks.MessageInjector"
group="synapse.simple.quartz" name="UpdateName" xmlns="http://ws.apache.org/ns/synapse">
<trigger cron="0/15 * * * * ?" />
<property name="message"
xmlns:task="http://www.wso2.org/products/wso2commons/tasks">
<def:login soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:def="http://DefaultNamespace" 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">
<id xsi:type="xsd:string">usr</id>
<pw xsi:type="xsd:string">pwd</pw>
</def:login>
</property>
<property name="sequenceName" value="main"
xmlns:task="http://www.wso2.org/products/wso2commons/tasks" />
<property name="injectTo" value="sequence"
xmlns:task="http://www.wso2.org/products/wso2commons/tasks" />
</task>
And this sequence:
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="main" xmlns="http://ws.apache.org/ns/synapse">
<in>
<send>
<endpoint>
<wsdl port="SakaiLogin" service="SakaiLoginService" trace="disable"
uri="http://myserver/sakai-axis/SakaiLogin.jws?wsdl" />
</endpoint>
</send>
</in>
<out>
<send />
</out>
<log level="full" />
</sequence>
Both from the examples shown in the documentation:
https://docs.wso2.com/display/ESB500/Adding+and+Scheduling+Tasks (See "Injecting the message to a named sequence or proxy service").
https://docs.wso2.com/display/ESB500/Sample+56:+Using+a+WSDL+Endpoint+as+the+Target+Endpoint (See "Building the sample").
However, I'm getting this error once I start the Carbon WSO2 ESB server:
[2017-01-27 17:03:45,005] ERROR - InMediator Runtime error occurred while mediating the message
java.lang.NullPointerException
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.isTransportSwitching(Axis2SynapseEnvironment.java:783)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:545)
at org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:382)
at org.apache.synapse.endpoints.WSDLEndpoint.send(WSDLEndpoint.java:75)
at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:121)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:97)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:59)
at org.apache.synapse.mediators.filters.InMediator.mediate(InMediator.java:74)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:97)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:59)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
at org.apache.synapse.mediators.MediatorWorker.run(MediatorWorker.java:80)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
[2017-01-27 17:03:45,023] INFO - LogMediator To: ,
MessageID: urn:uuid:097fb69e-6461-428e-ac85-93cfde65d02e,
Direction: request,
MESSAGE = Executing default 'fault' sequence,
ERROR_CODE = 0,
ERROR_MESSAGE = Runtime error occurred while mediating the message, Envelope:
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Body>
<def:login xmlns:def="http://DefaultNamespace" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<id xmlns="http://ws.apache.org/ns/synapse" xsi:type="xsd:string">usr</id>
<pw xmlns="http://ws.apache.org/ns/synapse" xsi:type="xsd:string">pwd</pw>
</def:login></soapenv:Body></soapenv:Envelope>
Can anybody give me a clue of what is going on?
Much appreciated!
In the wsdl endpoint the uri value must be the WSDL address, not the service endpoint:
WSDL URI The URI of the WSDL. Click Test to test the URI.
So, the WSDL endpoint inside the send mediator extracts the service endpoint from the WSDL document using the service and port name to find it inside the wsdl document.
UPDATE 1:
My task config xml:
<?xml version="1.0" encoding="UTF-8"?>
<task xmlns="http://ws.apache.org/ns/synapse"
name="UpdateName"
class="org.apache.synapse.startup.tasks.MessageInjector"
group="synapse.simple.quartz">
<trigger cron="0/15 * * * * ?"/>
<property name="proxyName" value="testTask"/>
<property name="message">
<moc:QRY_SELECT_SRH_EMPLEADO xmlns:moc="http://www.example.org/mockWS/">
<INT_ID>gero et</INT_ID>
</moc:QRY_SELECT_SRH_EMPLEADO>
</property>
<property name="soapAction"
value="http://www.example.org/mockWS/QRY_SELECT_SRH_EMPLEADO"/>
<property name="injectTo" value="proxy"/>
</task>
My sequence named main1:
<?xml version="1.0" encoding="UTF-8"?>
<sequence xmlns="http://ws.apache.org/ns/synapse" name="main1">
<in>
<header name="Action" scope="default" value="http://www.example.org/mockWS/QRY_SELECT_SRH_EMPLEADO"/>
<send>
<endpoint>
<wsdl service="mockWS"
port="mockWSSOAP"
uri="http://localhost:8088/mockmockWSSOAP?wsdl"/>
</endpoint>
</send>
</in>
<out>
<log level="full"/>
<drop/>
</out>
</sequence>
And finally I created a proxy with the same logic because a issue with the drop mediator inside a sequence:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="testTask"
transports="https http"
startOnLoad="true">
<target>
<inSequence>
<header name="Action" scope="default" value="http://www.example.org/mockWS/QRY_SELECT_SRH_EMPLEADO"/>
<send>
<endpoint>
<wsdl service="mockWS"
port="mockWSSOAP"
uri="http://localhost:8088/mockmockWSSOAP?wsdl"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<log level="full"/>
<drop/>
</outSequence>
<faultSequence/>
</target>
</proxy>

WSO2 ESB - Modifying the output message content in the proxy service

I use WSO2 ESB (4.8.1) and would like to know how to get the output as shown in the "Expected output" block.
Thanks in advance.
Proxy service definition:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="DATA_WS"
transports="https,http"
statistics="disable"
trace="enable"
startOnLoad="true">
<target>
<inSequence>
<switch xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
source="local-name(/*/*/*[1])">
<case regex="getSavProducts">
<payloadFactory media-type="xml">
<format>
<soapenv:Envelope xmlns:dat="http://ws.wso2.org/dataservice">
<soapenv:Header/>
<soapenv:Body>
<dat:getSavProducts/>
</soapenv:Body>
</soapenv:Envelope>
</format>
<args/>
</payloadFactory>
<log level="custom">
<property name="operation" value="getSavProducts"/>
</log>
<send>
<endpoint>
<address uri="http://dssserver:9783/services/DATA_WS/getSavProducts"/>
</endpoint>
</send>
</case>
<default/>
</switch>
</inSequence>
<outSequence>
<iterate xmlns:m="http://ws.wso2.org/dataservice"
id="iter1"
expression="//m:Entries/m:Entry">
<target>
<sequence>
<log level="custom">
<property name="output111" expression="//m:PRODUCT_DESC/text()"/>
</log>
<send/>
</sequence>
</target>
</iterate>
</outSequence>
</target>
<publishWSDL key="gov:/IB/DATA_WS.wsdl"/>
<parameter name="useOriginalwsdl">true</parameter>
<parameter name="disableOperationValidation">true</parameter>
<description/>
</proxy>
this is the output i get when calling the service
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<Entry xmlns="http://ws.wso2.org/dataservice">
<PRODUCT_CODE>2</PRODUCT_CODE>
<SUB_PRODUCT_CODE>20</SUB_PRODUCT_CODE>
<PRODUCT_DESC>TEST SUB PRODUCT</PRODUCT_DESC>
<STATUS>A</STATUS>
<PRODUCT_CATEGORY>G</PRODUCT_CATEGORY>
<PRODUCT_NAME>General</PRODUCT_NAME>
<CUR_CODE>GBP</CUR_CODE>
<CHANNEL>USSD</CHANNEL>
</Entry>
</soapenv:Body>
</soapenv:Envelope>
log
TID: [0] [ESB] [2016-10-31 10:39:33,761] INFO {org.apache.synapse.mediators.builtin.LogMediator} - output111 = TEST SUB PRODUCT {org.apache.synapse.mediators.builtin.LogMediator}
TID: [0] [ESB] [2016-10-31 10:39:33,761] INFO {org.apache.synapse.mediators.builtin.LogMediator} - output111 = TEST SUB PRODUCT 2 {org.apache.synapse.mediators.builtin.LogMediator}
TID: [0] [ESB] [2016-10-31 10:39:33,768] INFO {org.apache.synapse.mediators.builtin.LogMediator} - output111 = TEST SUB PRODUCT 3 {org.apache.synapse.mediators.builtin.LogMediator}
Expected output
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<ns1:getSavProductsResponse SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="DATA_WS">
<return xsi:type="ns2:dbconncyberfin_DbtSavProdcutTab" xmlns:ns2="http://dbconncyberfin/DATA_WS.xsd">
<array xsi:type="ns3:Array" ns3:arrayType="ns2:dbconncyberfin_DbtSavProdcutUser[16]" xmlns:ns3="http://schemas.xmlsoap.org/soap/encoding/">
<item xsi:type="ns2:dbconncyberfin_DbtSavProdcutUser">
<channel xsi:type="xsd:string">USSD</channel>
<curCode xsi:type="xsd:string">EUR</curCode>
<productCategory xsi:type="xsd:string">G</productCategory>
<productCode xsi:type="xsd:string">2</productCode>
<productDesc xsi:type="xsd:string">TEST SUB PRODUCT</productDesc>
<productName xsi:type="xsd:string">General</productName>
<status xsi:type="xsd:string">A</status>
<subProductCode xsi:type="xsd:string">20</subProductCode>
</item>
<item xsi:type="ns2:dbconncyberfin_DbtSavProdcutUser">
<channel xsi:type="xsd:string">USSD</channel>
<curCode xsi:type="xsd:string">USD</curCode>
<productCategory xsi:type="xsd:string">G</productCategory>
<productCode xsi:type="xsd:string">2</productCode>
<productDesc xsi:type="xsd:string">TEST SUB PRODUCT 2</productDesc>
<productName xsi:type="xsd:string">General</productName>
<status xsi:type="xsd:string">A</status>
<subProductCode xsi:type="xsd:string">54</subProductCode>
</item>
<item xsi:type="ns2:dbconncyberfin_DbtSavProdcutUser">
<channel xsi:type="xsd:string">USSD</channel>
<curCode xsi:type="xsd:string">SLR</curCode>
<productCategory xsi:type="xsd:string">G</productCategory>
<productCode xsi:type="xsd:string">1</productCode>
<productDesc xsi:type="xsd:string">TEST SUB PRODUCT 3</productDesc>
<productName xsi:type="xsd:string">General</productName>
<status xsi:type="xsd:string">A</status>
<subProductCode xsi:type="xsd:string">00</subProductCode>
</item>
</array>
</return>
</ns1:getSavProductsResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
solved it using xsl with xslt mediator.
item1.xsl
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
xmlns:m="http://ws.wso2.org/dataservice" version="2.0" exclude-result-prefixes="m fn"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns1="DATA_WS">
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="/">
<ns1:getSavProductsResponse>
<return xsi:type="ns2:dbconncyberfin_DbtSavProdcutTab" xmlns:ns2="http://dbconncyberfin/DATA_WS.xsd">
<array xsi:type="ns3:Array" ns3:arrayType="ns2:dbconncyberfin_DbtSavProdcutUser[16]" xmlns:ns3="http://schemas.xmlsoap.org/soap/encoding/">
<xsl:for-each select="//m:Entries/m:Entry">
<item xsi:type="ns2:dbconncyberfin_DbtSavProdcutUser">
<channel xsi:type="xsd:string"><xsl:value-of select="m:CHANNEL"/></channel>
<curCode xsi:type="xsd:string"><xsl:value-of select="m:CUR_CODE"/></curCode>
<productCategory xsi:type="xsd:string"><xsl:value-of select="m:PRODUCT_CATEGORY"/></productCategory>
<productCode xsi:type="xsd:string"><xsl:value-of select="m:PRODUCT_CODE"/></productCode>
<productDesc xsi:type="xsd:string"><xsl:value-of select="m:PRODUCT_DESC"/></productDesc>
<productName xsi:type="xsd:string"><xsl:value-of select="m:PRODUCT_NAME"/></productName>
<status xsi:type="xsd:string"><xsl:value-of select="m:STATUS"/></status>
<subProductCode xsi:type="xsd:string"><xsl:value-of select="m:SUB_PRODUCT_CODE"/></subProductCode>
</item>
</xsl:for-each>
</array>
</return>
</ns1:getSavProductsResponse>
</xsl:template>
outSequence
<outSequence>
<xslt key="gov:/xslt/item1.xsl"/>
<enrich>
<source type="body" clone="true"/>
<target type="property" property="original"/>
</enrich>
<payloadFactory media-type="xml">
<format>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body/>
</SOAP-ENV:Envelope>
</format>
<args/>
</payloadFactory>
<enrich>
<source type="property" clone="true" property="original"/>
<target type="body"/>
</enrich>
<send/>
</outSequence>

How would i transform the message Dynamically In WSO2ESB

I am using wso2esb4.8.0
I wish to transform the message using wso2esb .Actaulle need to add Complex Element to Payload
How would i achive this.
my Client request is
<?xml version="1.0" encoding="UTF-8"?>
But my Adapter endpoint will allow the request in this format.If it is for one operation i may follow payload mediator to make my request But those are bumch of requests
so Endpoint allowing request is
Just extract the Operation_Name and adding it as Complex Element But I am unable to do it I am trying in Proxy like this
Proxy is
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="SamplePOC7"
transports="https,http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<property xmlns:open="http://www.openuri.org/"
xmlns:ns="http://org.apache.synapse/xsd"
xmlns:env="http://eai.mmn.mm/Envelope"
xmlns:poin="http://eai.mm.mm/gg"
name="Operation_Name"
expression="//poin:Operation_Name/text()"
scope="default"
type="STRING"/>
<property xmlns:open="http://www.openuri.org/"
xmlns:ns="http://org.apache.synapse/xsd"
xmlns:env="http://eai.mmn.xxxx/Envelope"
name="AddElement"
expression="concat('open:',get-property('Operation_Name'))"
scope="default"
type="STRING"/>
<enrich>
<source xmlns:env="http://eai.mmn.mm/Envelope"
clone="true"
xpath="//env:Payload/*"/>
<target xmlns:poin="http://eai.mm.XXX/gg"
xpath="concat('open:',//poin:Operation_Name/text())"/>
</enrich>
<log level="full">
<property name="Message" expression="get-property('AddElement')"/>
</log>
</inSequence>
<outSequence/>
</target>
<description/>
</proxy>
But its giving errors like the below my error log is
[2014-05-15 10:53:48,167] INFO - ProxyService Successfully created the Axis2 se
rvice for Proxy service : SamplePOC7
[2014-05-15 10:53:53,089] ERROR - EnrichMediator Invalid Target object to be enr
ich.
[2014-05-15 10:54:19,160] INFO - ProxyService Building Axis service for Proxy s
With which mediator i can extract this request as per my desire way please if you know paste configuration or else provide any example
Thanks in advance
You can use XSLT mediator or JavaScript
A sample proxy with javascript doing what you want :
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="TestSOF"
transports="http"
startOnLoad="true"
trace="disable">
<description/>
<target>
<inSequence>
<property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
<property xmlns:open="http://www.openuri.org/"
xmlns:ns="http://org.apache.synapse/xsd"
xmlns:poin="http://eai.mtn.iran/PointOfSales"
name="Operation_Name"
expression="//poin:Operation_Name/text()"
scope="default"
type="STRING"/>
<property xmlns:ns="http://org.apache.synapse/xsd"
xmlns:poin="http://eai.mtn.iran/PointOfSales"
name="PointOfSales"
expression="//poin:PointOfSales"
scope="default"
type="STRING"/>
<script language="js"><![CDATA[
mc.setPayloadXML(<open:{mc.getProperty("Operation_Name")} xmlns:open="http://www.openuri.org/">
{new XML(mc.getProperty("PointOfSales"))}
</open:{mc.getProperty("Operation_Name")}>);
]]></script>
<log level="full"/>
</inSequence>
</target>
</proxy>
A sample using XSLT :
<?xml version="1.0" encoding="UTF-8"?>
<localEntry xmlns="http://ws.apache.org/ns/synapse" key="SOFXSL">
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:open="http://openuri.org/"
xmlns:env="http://eai.mtnn.iran/Envelope"
xmlns:poin="http://eai.mtn.iran/PointOfSales"
version="2.0">
<xsl:output method="xml" encoding="utf-8" indent="yes" omit-xml-declaration="no"/>
<xsl:param name="operationname"/>
<xsl:template match="/">
<xsl:element name="open:{$operationname}">
<xsl:apply-templates select="//poin:PointOfSales"/>
</xsl:element>
</xsl:template>
<xsl:template match="#*|*|comment()">
<xsl:copy>
<xsl:apply-templates select="#*|*|text()|comment()|processing-instruction()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
<description/>
</localEntry>
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="TestSOF"
transports="http"
startOnLoad="true"
trace="disable">
<description/>
<target>
<inSequence>
<property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
<property xmlns:open="http://www.openuri.org/"
xmlns:ns="http://org.apache.synapse/xsd"
xmlns:poin="http://eai.mtn.iran/PointOfSales"
name="Operation_Name"
expression="//poin:Operation_Name/text()"
scope="default"
type="STRING"/>
<xslt key="SOFXSL">
<property name="operationname" expression="get-property('Operation_Name')"/>
</xslt>
<log level="full"/>
</inSequence>
</target>
</proxy>

WSO2 ESB Web destroys nice synapse XML structure

We developed our proxies, sequences and so on with a XML editor and had a very good structure of the synapse configurations, but as we open the component with the web interface and the whole code is realigned and changed.
Is there a way to see the content of the components with the web without destroying the whole structure?
This here was our code:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse" name="patient_toMPI_pJMS_qToMPIXml" statistics="disable" trace="disable" transports="jms">
<parameter name="transport.jms.Destination">queueName</parameter>
<parameter name="transport.jms.ConnectionFactory">queueBlocking</parameter>
<parameter name="transport.jms.DestinationType">queue</parameter>
<parameter name="transport.jms.ContentType">
<rules>
<jmsProperty>contentType</jmsProperty>
<default>application/xml</default>
</rules>
</parameter>
<target faultSequence="rollbackSequence">
<inSequence>
<property name="frameworkContext" expression="get-property('default', 'frameworkContext')" scope="transport"/>
<property name="frameworkMessageId" expression="get-property('default', 'frameworkMessageId')" scope="transport"/>
<property name="frameworkTransactionId" expression="get-property('default', 'frameworkTransactionId')" scope="transport"/>
</inSequence>
</target>
After opening just once with the web interface it looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="patient_toMPI_pJMS_qToMPIXml"
transports="jms"
startOnLoad="true"
trace="disable">
<target faultSequence="rollbackSequence">
<inSequence>
<property xmlns:urn="urn:hl7-org:v2xml"
xmlns:hl7="http://wso2.org/hl7"
name="frameworkContext"
expression="get-property('default', 'frameworkContext')"
scope="transport"/>
<property xmlns:urn="urn:hl7-org:v2xml"
xmlns:hl7="http://wso2.org/hl7"
name="frameworkMessageId"
expression="get-property('default', 'frameworkMessageId')"
scope="transport"/>
<property xmlns:urn="urn:hl7-org:v2xml"
xmlns:hl7="http://wso2.org/hl7"
name="frameworkTransactionId"
expression="get-property('default', 'frameworkTransactionId')"
scope="transport"/>
</inSequence>
</target>
<parameter name="transport.jms.ContentType">
<rules>
<jmsProperty>contentType</jmsProperty>
<default>application/xml</default>
</rules>
</parameter>
<parameter name="transport.jms.ConnectionFactory">queueBlocking</parameter>
<parameter name="transport.jms.DestinationType">queue</parameter>
<parameter name="transport.jms.Destination">queueName</parameter>
</proxy>
Is this a bug within WSO2? Is it configurable?
I don't see much change done in your configuration. Properties are pushed down to the bottom (thats the only change I see) and thats the normal behaviour in WSO2 ESB.
There is no way to view the source without using the web console (unless you view it from the file system).