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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Am using GetText method to get data from Web Service but am getting Connection close when huge data is sent

nbhagtani
12-Amethyst

Am using GetText method to get data from Web Service but am getting Connection close when huge data is sent

params = {

  url: "http://178.21.406.842/api/GetHistoricalDataByAttributes?"+encodeURI(queryParams)

};

var historicJson = Resources["ContentLoaderFunctions"].GetText(params);


Above is code am writing to get historic data. If am trying to get last 6 months data which is huge like more than 300Mb in that case it gives  me connection close.

Am testing above code as thingworx service from fiddler client and i receive 500 status and connection close.

How to optimize in thingworx if data sent is huge and stop closing the connection?

4 REPLIES 4

When am testing i get following error:

"The request was aborted: The connection was closed unexpectedly. at System.Net.HttpWebRequest.GetResponse()"

I don't think REST API it's the right approach to download 300Mb of data, or at least right on TW. You may need a proxy which does this job and puts historical data on FileRepository ( or FTP Server ), or you may try to Zip contents at origin to see if size decreases on a significative way, or cut original data in junks ( let's ask instead of 6 months of data, ask in junks of 15 days of data --> will be about 25Mb )

jamesm1
12-Amethyst
(To:CarlesColl)

This is likely a limit of the webserver that you are making the GET request to and/or your Tomcat configuration, not a limit of Thingworx. Please see the following StackOverflow question: web services - maximum length of HTTP GET request? - Stack Overflow

That said, HTTP may not be the best way to expose this data, as noted by Carles.

nbhagtani
12-Amethyst
(To:jamesm1)

Can we set limit of response returned from GET request in tomcat? Response which i am receiving is huge data

Announcements


Top Tags