1

I'm calling my webservice from an Android application one after another. And at every call it returns with almost 3.5KB data.

I'm using JavascriptSerializer class to serialize and convert to JSON string my Dictionary<string,string> or Dictionary<string,string>[] objects. (Especially Dictionary<string,string>[])

Is there a way to reduce this amount of data. It's so much.Or am i doing something wrong?

Thanks..

Sercan Ozdemir
  • 4,641
  • 3
  • 34
  • 64

1 Answers1

-1

Script files loaded via an HTML element within a browser can only be retrieved via HTTP GET verb requests.

By default ASP.NET AJAX's web services layer does not allow web methods to be invoked via the HTTP GET verb. For example, assume a developer writes a web service method like below:

[WebMethod]
public StockQuote[] GetQuotes(string symbol) {

}

ASP.NET will only allow the above GetQuotes method to be called via the HTTP POST verb, and will reject all attempts to invoke the method via an HTTP GET verb.

To make an ASP.NET AJAX web-method callable via HTTP GET-access, a developer must explicitly attribute each method using ASP.NET's ScriptMethod attribute (and set the UseHttpGet property to true):

[WebMethod] 
[ScriptMethod(UseHttpGet=true)] 

public StockQuote[] GetQuotes(string symbol) { 

} 

for more info please refer below link

http://weblogs.asp.net/scottgu/archive/2007/04/04/json-hijacking-and-how-asp-net-ajax-1-0-mitigates-these-attacks.aspx

Varun
  • 373
  • 1
  • 2
  • 11