JSON Web Service

Discussion in 'ASP.NET WebServices' started by stumac, Mar 10, 2008.

  1. Hi guys,

    Do any of you know and have the time to go through a detailed explanation of a JSON web service?
    I'm just playing around with this to learn more.
    Current situation is this.
    I have a web service set up on DASP which is just returning a string. The string in this case is an <img src.... string, pointing the src to an image also held on DASP. Wanted something visual to output so it's clear if it's working right.
    The web service is called from a completely different domain (lets call it domainx) through the use of dynamic script tags.
    The web service appears to work, and I only say appears due to my limited knowledge, as a script element is built on domainx with some code inside it. Using Firebug through Firefox I can see that the code written within the script is as follows;


    <string xmlns="http://tempuri.org/">{"imageStr":"&amp;lt;img src='http://www.domainx.com/images/1.gif' /&amp;gt;"}</string>

    (This output also appears when I call the webservice directly in a browser and invoke it.)

    When it renders, the callback function appears not to be called. Probably due to the fact that a javascript error is raised, saying that there's a missing ; at the xmlns point in the string.

    So first question please.
    Is this JSON output? The xml tag confuses me as, well, it seems to indicate xml output.
    I can provide plenty more code and info as I've googled this to bits and I'm still non the wiser.

    So is it my webservice which is providing the wrong output? Is it a setting in the web.config file? Is it a problem on domainx with parsing the json output?

    Some insight please.....................!!!

    Cheers,

    Stu.
     
  2. Thanks wisemx, these look really promising. Guess I didn't Google hard enough to find them!!


    It's just great to have a good community like this as a very strong backup. Pushed for time the next few nights but hopefully get my teeth into it at the weekend (where did my life go?) and I'll post back what happens.


    Thanks again for taking the time to post.


    Cheers,


    Stu
     

Share This Page