Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I had the same symptoms with a different scenario so this may or may not help.</p> <p>Here is a breif summary of what I was doing and our solution:</p> <p>I was posting to a REST implementation of a WCF service that we host from a classic ASP page. I found I had to set the input as a stream and read from that, disposing of the stream when done. I beleive it was at this point I was getting the 202 response with text of "success" as you have described. I discovered that by not disposing of the stream I was getting the response I was expecting for error conditions.</p> <p>Here is a summary of the final code:</p> <pre><code>[WebHelp(Comment="Expects the following parameters in the post data:title ...etc")] public int SaveBook(Stream stream) { NameValueCollection qString; StreamReader sr = null; string s; try { /************************************************************************************** * DO NOT CALL DISPOSE ON THE STREAMREADER OR STREAM * * THIS WILL CAUSE THE ERROR HANDLER TO RETURN A PAGE STATUS OF 202 WITH NO CONTENT * * IF THERE IS AN ERROR * * ***********************************************************************************/ sr = new StreamReader(stream); s = sr.ReadToEnd(); qString = HttpUtility.ParseQueryString(s); string title = qString["title"]; //Do what we need //Then Return something int retRecieptNum = UtilitiesController.SubmitClientEntryRequest(entryReq); return retRecieptNum; } catch (Exception ex) { throw new WebProtocolException(System.Net.HttpStatusCode.Forbidden, ex.Message, this.GetExceptionElement(true, "BookRequest", ex.Message), false, ex); } finally { } } </code></pre> <p>Hopefully this is some help to you, maybe try using a stream and see how that goes.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload