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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

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

tpersson1
1-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.

2 REPLIES 2
dmoon
5-Regular Member
(To:tpersson1)

The url "http://www.thingworx.com/feed" has been removed. So, please use other rss feed to get your job done. I recommend you to use google news feed instead since that is pretty persistent and its url is "https://news.google.com/news/feeds".

And you used same variable name "params" twice. I recommend you not to use duplicate variable names in one script.

Regards,

Daniel

Me too getting a same error.

HoweverWrapped org.xml.sax.SAXParseException; lineNumber: 1; 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.


However I ran run my web services through SOAPUI without any issues.


Having trouble here in thingworx.

Announcements


Top Tags