WCF安心服务

标签 wcf rest

我正在使用 WCF 4.0 开发 WCF Restful 服务。我的问题如下:

  1. 服务器端的post方法如下图: enter image description here enter image description here

  2. 向服务器发出post请求的代码如下图: enter image description here

  3. 但是当我调试服务时,我发现 id 属性发生了如下图所示的更改: enter image description here

我很困惑为什么 ID 属性的值发生了变化?

最佳答案

型号id字段大小写不匹配;您正在传递 model.ID 并且您正在尝试读取 model.Id。 GetModel() 方法中的 JObject 更改为 model.Id 而不是 model.ID >.

关于WCF安心服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22187123/

相关文章:

c# - 使用反射从 Soap Client 获取 Web 服务方法

rest - 如何通过简单产品 Magento 2 REST API 进行配置

c# - 为什么RestSharp不支持Windows Phone上的同步请求?

java - Spring 启动: automatic JSON message converter for @Requestbody GET doesn't work

java - 使用 camel rest-dsl 相互调用

c# - 使用 Delphi 使用 WCF - 最大字符串内容长度配额 (8192) 错误

c# - 如何只允许每个用户一个 session

c# - WCF 中的 DataContract 问题

.net - 服务契约(Contract)的 PrincipalPermission 属性

web-services - 选择 REST 风格 Web 服务而不是 Soap 的论点