Wrong webservice message integrating with Actionscript

Asked

Viewed 40 times

3

I’m making an application restful in C#, where I will receive a request via post and return a JSON or a string to the applicant.

[HttpPost]
    public string confirmahora()
    {         
        String OUTPUT = "mensagem";

        HttpConfiguration config = new HttpConfiguration();
        config.Formatters.Remove(config.Formatters.JsonFormatter);   

        return resposta;
    }

But when the Flash application (Actionscript) receives the following header:

<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">"mensagem"</string>

It would only have to come the word "message".

1 answer

1


Before returning the reply, make sure that the response header will return text/plain, thus:

[HttpPost]
public string confirmahora()
{         
    String OUTPUT = "mensagem";

    HttpConfiguration config = new HttpConfiguration();
    config.Formatters.Remove(config.Formatters.JsonFormatter);
    System.Web.HttpContext.Current.OutgoingResponse.ContentType = "text/plain";

    return resposta;
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.