WCF 接口定义为
控制台调用方法如下
控制台如果添加服务引用 生成代理类访问可以成功请求
但是像这样访问 就会报415错误
用postman也是这个错误 什么问题啊 快懵逼了
详细错误
StatusCode: 415, ReasonPhrase: 'Cannot process the message because the content type 'application/json; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'.', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
X-SourceFiles: =?UTF-8?B?RTpcQ29kZVxNZW5nR3VhbmdIUlxNRy5IUi5XQ0ZTZXJ2aWNlXEFjdGl2aXRpV0ZTZXJ2aWNlLnN2Y1xhcGlcVGFza0NoYW5nZWQ=?=
Cache-Control: private
Date: Sun, 28 Apr 2019 07:12:39 GMT
Server: Microsoft-IIS/10.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Content-Length: 0
}