我创建了一个 Web 服务,并且可以在该服务在我的本地服务器(ASP.NET 开发服务器)上运行时使用 WCF 测试客户端调用这些方法。
但是,当我将 Web 服务发布到 QA 服务器并调用其中一种方法时,再次使用测试客户端,我收到以下错误消息:
The content type text/html; charset=UTF-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8).
在使用 Fiddler 检查请求后,我发现我返回的是默认页面,就好像我访问了 mywebservice.svc:
You have created a service.
To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax:
我不明白为什么会返回默认页面而不是调用该方法。我是否需要在服务器上执行任何操作以允许调用该方法?我需要设置任何 MIME 类型吗?