json - Reading HttpRequest Body in REST WCF -


I have a pure WCF service running in 4 NT and I have tested this working web service and I have HttpRequest Accepting I have to do this but I have a problem trying to use the HTPPX body within the web service. I have tried to send the size of the random size I added to HttpRequest which is using both the Fenderler and my WinForm app and I can not find an object in the runtime where I can get my request body. My initial trend was to look in HttpContext.Current.Request.InputStream , but the length of that property is 0, so I tried to look at the IncomingWebRequestContext that the object was also

So my question is, is there really a way to access the HTTP request request body in WCF?

PS: There is a JSON wire inside the data request body and for this response the data will return the data as JSON string even within the body.

Very easy, this answer is fine on the job.

In addition, if your request is body deserializable, then you can pass only one class. Excluding some typo, this should work:

  Creating Public Square {public string color; Public int size; }  

... [WebInvoke (method = "POST", UriTemplate = "bananas", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat) Jason)] Create stringBenana (made);

...

  create a public string (made) {return "This is a +" Collar + "banana!"; }  

Posting with data {"color": "blue", "size": 5} should return this resource to "it Have a Blue! ".


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -