asp.net - How to create a web service which returns JSON rather than XML for GET and POST (no AJAX)? -
i create web service returns results json in asp.net http , post bindings.
in other words webservice return json if 1 types it's url in browser. xml representation done automatically in net 3.5.
i know can use scriptmethod (as shown below) make ajax calls return json, not i'm after.
[webmethod] [scriptmethod(responseformat = responseformat.json)] public someclass example()
ok, saying (if understand correctly), web service uses soap, , json not part of soap. json it's own protocol. don't want use web service framework?
if can use simple httphandler returns data in form of json
here example of http://johnnycoder.com/blog/2008/12/16/httphandler-json-data/
Comments
Post a Comment