How do I construct a request for a WCF http post call?

Posted by James Hay on Stack Overflow See other posts from Stack Overflow or by James Hay
Published on 2010-05-05T10:13:46Z Indexed on 2010/05/12 9:44 UTC
Read the original article Hit count: 235

Filed under:
|
|

I have a really simple service that I'm messing about with defined by:

[OperationContract]
[WebInvoke(UriTemplate = "Review/{val}", RequestFormat = WebMessageFormat.Xml, Method = "POST", BodyStyle=WebMessageBodyStyle.Bare)]
void SubmitReview(string val, UserReview review);

UserReview is, at the moment, a class with no properties. All very basic. When I try and test this in Fiddler I get a bad request status (400) message.

I'm trying to call the service using the details:

POST http://127.0.0.1:85/Service.svc/Review/hello

Headers

User-Agent: Fiddler
Content-Type: application/xml
Host: 127.0.0.1:85
Content-Length: 25

Body

<UserReview></UserReview>

I would think i'm missing something fairly obvious. Any pointers?

© Stack Overflow or respective owner

Related posts about wcf

Related posts about http