Link to home
Start Free TrialLog in
Avatar of Advoco
Advoco

asked on

XMLHttpRequest responseText is truncated or not returned when return large amounts of data

Hi,

I am developing a web solution that will use javascript to call a WCF Restful service. The javascript is stored in a normal Html page.
I use XMLHttpRequest to send the request to the WCF service and use the responseText from the XMLHttpRequest object to parse the response from the WCF Post.
However if the WCF returns to much information I will get a 12152 status from the XMLHttpRequest object.
Attached is a zip file that contains the following:
1. A SQL script
2. A VS 2010 project

Please do the following steps before opening the VS project:
1. Open the "Create Store Table.sql" script, create a database and run this script, it will create a store table and populate it with 10,000 rows (the script was created and run on SQL server 2008R2)
2. "WCFPoc.sln" this is a VS 2010 project, the file "WCFPoc\Store.svc.cs" needs to be renamed to "WCFPoc\Store.svc" as the upload doesn't except file extensions of .svc
3. In "WCFPoc\App_Data\IStore.cs" the connection string in the GetStores function needs to be set to the DB used where the script in step 1 was run.

Please open the project when the above steps have been completed, the following steps describe the issue that I really need to fix:
1. Select the "SearchStores.htm" file and run the project.
2. Click on one of the buttons in the htm page (do not enter any text in the text boxes)
3. The Results Text box will appear with "Status:12152 Text:Unknown" these is the XMLHttpRequest status code returned when there is to much information.
4. Open "App_Data\IStore.cs" and uncomment the line "//string sql = " and comment the line below this in the GetStores function.
5. Do step 1 & 2 again
6. The reponseText from the XMLHttpRequest object contains valid information.

I have tried a number of different things, but none have helped.
In the Web.config I changed transferMode="Buffered" to transferMode="Streamed", this does return reponseText, however the text is truncated and does not contain all the return information.
I suspect it's nothing to do with the WCF as I have set the maxReceivedMessageSize to 2,147,483,647, I have also set the maxStringContentLength to large number, but they do not effect the results in any way.

Any ideas would be of great help.
 WCFPoc.zip
Avatar of Advoco
Advoco

ASKER

Increasing points for question
ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial