on ‎2014 Apr 10 1:10 AM
Hi Experts,
Need Your help to know how i can get the transaction output in Plain Text form using the URL.
Currently I am trying the following URL :
http://<server>/XMII/Runner?Transaction=Default/TDLF/TestTrxforYUI&Server=XacuteConnector&Mode=Query&OutputParameter=Text&type=text
Output :
<?xml version="1.0" encoding="UTF-8" ?>
</Columns>
</Row>
</Rowset>
</Rowsets>
But i need the output in plain text format as
HelloWorld
Thanks
Shashank
Request clarification before answering.
Hi Shashank,
If the output of the transaction call is an XML and you need to parse the data out of it then the content-type should remain as 'text/xml'. You can parse the XML using the parse function below. I found this on searching the web but unfortunately don't remember the source.
| var parseXml; | |
| var groups = []; | |
| var recordlist = ""; |
| if (typeof window.DOMParser != "undefined") { | ||
| parseXml = function(xmlStr) { | ||
| return ( new window.DOMParser() ).parseFromString(xmlStr, "text/xml"); | ||
| }; | ||
| } else if (typeof window.ActiveXObject != "undefined" && | ||
| new window.ActiveXObject("Microsoft.XMLDOM")) { | ||
| parseXml = function(xmlStr) { | ||
| var xmlDoc = new window.ActiveXObject("Microsoft.XMLDOM"); | ||
| xmlDoc.async = "false"; | ||
| xmlDoc.loadXML(xmlStr); | ||
| return xmlDoc; | ||
| }; | ||
| } else { | ||
| throw new Error("No XML parser found"); | ||
} You can call it like parseXML(<data_received>) Hope this helps! Regards, Saumya Govil |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shashank,
1. If you just want to get the output xml as string, then append 'content-type=text/plain' at the end of your runner URL.
2. But if you are looking to get the value of your output parameter 'Text' as string, then you need to parse through the xml and get the string value.
MII transaction gives output as xml in the Rowsets-->Rowset-->Row format and never a singular string.
Parsing through an xml can be a bit tedious, hence a better way to do it is, that you get the output of your transaction using Xacute query as JSON and get your string value by simple parsing of JSON as Rowsets.Rowset[0].Row[0].Text
http://<host>:<port>/XMII/Illuminator?QueryTemplate=<Xacute query path>&content-type=text/json
Regards,
Rutika Bodas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shashank,
Just mention Content-Type=text instead type in your URL as below ,it works
http://<server>/XMII/Runner?Transaction=Default/TDLF/TestTrxforYUI&Server=XacuteConnector&Mode=Query&OutputParameter=Text&Content-Type=text
Cheers,
Padma Rao
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.