开发者

issue with posting to WCF REST service

开发者 https://www.devze.com 2022-12-09 00:41 出处:网络
I created a REST service using WCF. It has 2 operations; one has [WebGet] applied to it and works fine both on开发者_开发技巧 localhost and on my production server.

I created a REST service using WCF. It has 2 operations; one has [WebGet] applied to it and works fine both on开发者_开发技巧 localhost and on my production server.

But, the other operation that has the following attribute applied to it works the only localhost, not on the production server. Can anybody tell me what could be wrong here?

The attribute in question is:

[WebInvoke(Method = "POST",
           BodyStyle = WebMessageBodyStyle.Wrapped,
           ResponseFormat = WebMessageFormat.Json,
           RequestFormat = WebMessageFormat.Json,
           UriTemplate = "CreateUser")]

The error that I am getting is a bad request (400). The JSON request sent is the same for both localhost and prod server. It also has content type set to application/json.

0

精彩评论

暂无评论...
验证码 换一张
取 消