0

Hello I am building a website with a GWT frontend and a .NET backend. Now i'm having problems getting JSON from de backend. This is my backend code:

    [WebMethod]
    [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
    public string TestJSON()
    {
        Employee[] e = new Employee[2];
        e[0] = new Employee();
        e[0].Name = "Ajay Singh";
        e[0].Company = "Birlasoft Ltd.";
        e[0].Address = "LosAngeles California";
        e[0].Phone = "1204675";
        e[0].Country = "US";
        e[1] = new Employee();
        e[1].Name = "Ajay Singh";
        e[1].Company = "Birlasoft Ltd.";
        e[1].Address = "D-195 Sector Noida";
        e[1].Phone = "1204675";
        e[1].Country = "India";
        return new JavaScriptSerializer().Serialize(e);
    }

I am making the request through a JsonpRequestBuilder in GWT but it only sends back the JSON wrapped in XML. When i am using the RequestBuilder in GWT i have the SOP problem. My Question is is it possible to get JSON this way? and if not what is the best way to accomplisch this. Thank you.

chris
  • 343
  • 4
  • 13

1 Answers1

0

If you have only the SOP error, yes, you can UAE this way to get the info.

The only thing that you have to do is deploy your backend into a real server, not Localhost.

My 2 cents,

Adolfo.

apanizo
  • 628
  • 5
  • 11