cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Transaction Execution from URL

Former Member
0 Likes
477

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" ?>

- <Rowsets DateCreated="2014-04-09T23:41:19" EndDate="2014-04-09T23:41:19" StartDate="2014-04-09T23:41:19" Version="14.0.0 Build(802)" TransactionID="-1">

<Rowset TrxID="-1">

<Columns>

<Column Description="Text" MaxRange="0.0" MinRange="0.0" Name="Text" SQLDataType="1" SourceColumn="Text" />

</Columns>

<Row>

<Text>HelloWorld</Text>

</Row>

</Rowset>

</Rowsets>

But i need the output in plain text format as

HelloWorld



Thanks

Shashank

Accepted Solutions (0)

Answers (3)

Answers (3)

saumya_govil
Active Contributor
0 Likes

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

Former Member
0 Likes

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

Former Member
0 Likes

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