How to return correct (not 200) status when WebFaultException was throw with jsonp? RRS feed

  • Question

  • Hi everybody!

    I have:

    Server-side - WCF, which works as windows-service.

    Client -  one-page ajax-driven html.

    When my WCF throw new WebFaultException "throw new WebFaultException<string>("error text", HttpStatusCode.BadRequest);", client receive response with 200 status, but I want 400. This is because crossDomainScriptAccessEnabled="true".

    Is there a way to disable callback (padding) when WebFaultException happens to receive correct status.
    At the same time with no-wrong situations WCF must return jsonp. 

    Please suggest me any normal solution.

    Thanks and sorry for my english, 


    Friday, September 12, 2014 9:21 AM