I am having a service orientedwebsite that all its html is generated by wcf services . I am having my services deployed live . but the problem is in wcf code I always return the request as bad request , but I make my action in the statustext , like success error etc… so the problem that the services isnt working 100% time fine , sometimes they return the statusText as supposed , sometimes they return BAD REQUEST , which makes a mess in my application. Is there any iis setting or something that I must write to make sure that it returns statusText as supposed? this is my code for changing it in WCF:
//Set the http status code
currentContext.OutgoingResponse.StatusCode = System.Net.HttpStatusCode.BadRequest;
//set the msg
currentContext.OutgoingResponse.StatusDescription = "Success";
I am using jQuery 1.4.2 and WCF 4.0
Some platforms do not accept custom status description texts – that depends on the browser, the OS, and likely some other factor (I know that Safari on Macs don’t). Just don’t do that. The HTTP RFC specifies what each status code means (so those platforms may take advantage of that and skip parsing the rest of the first line of the response header). If you really need to convey some additional information, try using some custom response header: