【问题标题】:wcf Pass Parameter But error 400wcf传递参数但错误400
【发布时间】:2017-04-16 17:21:58
【问题描述】:

我正在呼叫服务 http://xxxx:8102/GetDataOragn.svc/Test 但收到 400 个错误请求

[WebInvoke(UriTemplate = "Test", Method = "POST", RequestFormat = 
WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
[OperationContract]
Result Test(string s);

[OperationBehavior]
    public Result Test(string s)
    {
        return new Result() { Code = 0, Description = s, State =true };
    }

输入: 我正在使用邮递员和

Content-Type:application/json
Body:raw
{
 "s":"THIS IS A TEXT MESSAGE"
}

帮助

【问题讨论】:

    标签: c# json web-services wcf post


    【解决方案1】:

    您的输入格式错误。把这个贴出来:

    "String content"
    

    在你的情况下,我相信它会是这样的:

    "THIS IS A TEXT MESSAGE"
    

    【讨论】:

      猜你喜欢
      • 2021-10-24
      • 1970-01-01
      • 2011-06-03
      • 1970-01-01
      • 1970-01-01
      • 2014-12-18
      • 1970-01-01
      • 2018-05-09
      • 2015-10-08
      相关资源
      最近更新 更多