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

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

nbhagtani
Guest

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?

Tags (1)
4 REPLIES 4

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

When am testing i get following error:

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

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

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 )

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

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.

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

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

Announcements

Check out the upcoming Expert Session: Understanding ThingWorx Navigate Licensing in Community "Customer Events" section.