Consuming JSON Web Service from jQuery and Server Code

This is a trick i learned today, if you have your web service returning JSON string to utilize on your ajax calls if you planned to connect to this service using server code (Web Reference) for internal facing app for example you have a problem.

If you are using HttpModule to alter the content-type to application/json you need to disabled this first, add web reference and then re-enable it again.

when trying to add web reference with Visual Studio you can’t get valid disco/wsdl files however if you added the reference while disabling the HttpModule and re-enable it again, it works.

Hope this helps.

One thought on “Consuming JSON Web Service from jQuery and Server Code”

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>