1 Reply Latest reply on Mar 20, 2016 8:31 PM by kmoon RSS
    tpersson Newbie

    How to get rid of SAXParserError using getXML() call?

    Being new to ThingWorx I´m trying to follow an example to retrieve data using the code:

     

    var params = {

      proxyScheme: undefined /* STRING */,

      headers: undefined /* JSON */,

      ignoreSSLErrors: undefined /* BOOLEAN */,

      useNTLM: undefined /* BOOLEAN */,

      workstation: undefined /* STRING */,

      useProxy: undefined /* BOOLEAN */,

      withCookies: undefined /* BOOLEAN */,

      proxyHost: undefined /* STRING */,

        url: "http://www.thingworx.com/feed" /* STRING */,

      timeout: undefined /* NUMBER */,

      proxyPort: undefined /* INTEGER */,

      password: undefined /* STRING */,

      domain: undefined /* STRING */,

      username: undefined /* STRING */

    };

     

    // result: XML

    var xmlPage = Resources["ContentLoaderFunctions"].GetXML(params);

     

    var params = {

        infoTableName : "InfoTable",

        dataShapeName : "ThingWorxFeedData"

    };

     

    var result = Resources["InfotableFunctions"].CreateInfoTableFromDataShape(params);

     

    for each (var item in xmlPage.channel.item){

        var row = new Object();

        row.title = item.title;

        row.link = item.link;

        result.AddRow(row);

    }

     

    where ThingWorxFeedData is a defined existing DataShape.

     

    When I test the service the error message below is the result:

     

    Error executing service

    Wrapped org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 10; DOCTYPE is disallowed when the feature "http://apache.org/xml/features/disallow-doctype-decl" set to true. Cause: DOCTYPE is disallowed when the feature "http://apache.org/xml/features/disallow-doctype-decl" set to true.

    Please advise, what do I do now?

    I´m running ThingWorx in a browser over VPN to a SI installation in our local office.