I have a .NET webservice that returns JSON. I use it with a JSONP call from my small webapp.
Everything is fine, until the response reaches a certain size. The best way I can desribe it is, it gets split like the following
jQuery16405120642159599811_1347881418555({“d”:[{“RessourceId”:1022,”Duration”:3600,”StartDateTime”:”/Date(1348030800000)/”,”Name”:”SPINCLASS”,”Capacity”:24,”Color”:”009900″,”ShowRessourceToMembersId”:1,”ShowOtherBookingsToMembers”:1,”FreeSpace”:22,”Rooms”:”ROOM1″,”Instructors”:”NONE”:0,”Description”:”AND SO ON”}{{“RessourceId”:1022,”Duration”:3600,”StartDateTime”:”/Date(1348030800000)/”,”Name”:”SPINCLASS”,”Capacity”:24,”Color”:”009900″,”ShowRessourceToMembersId”:1,”ShowOtherBookingsToMembers”:1,”FreeSpace”:22,”Rooms”:”ROOM1″,”Instructors”:”NONE”:0,”Description”:”AND SO ON”}{CenterId”);jQuery16405120642159599811_1347881418555(:909088,}…
So in the middle of my response I get a new callback function inserted? It happens after about 13355 chars.
What is causing this, and how should I address this issue?
The problem was how the Callback method was added in the Httpmodule jsonresponsefilter. The callback was added in the write method, which caused problems, when the buffer got filled. Instead, its now added in the flush method, and works like a charm. I got the answer from here, at the bottom answer Json HTTP Module stream issue