gpt4 book ai didi

c# - WCF Web 服务错误 : "Service endpoint binding not using HTTP protocol"?

转载 作者:可可西里 更新时间:2023-11-01 08:31:41 24 4
gpt4 key购买 nike

我有一个简单的 WCF 服务,在我的开发机器上测试时它运行良好。

现在我已将 Web 服务移至 Web 服务器,并在 http://mydomain.com:8005 运行该服务(在 Debug模式下) .打开 Web 浏览器访问该 URL 会显示预期的服务页面,如果我在我正在调用的界面内的服务器上放置一个断点,它会命中断点并返回预期的数据......但在客户端它会返回出现以下错误:

An error occurred while receiving the HTTP response to http://mydomain.com:8005/. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.

更多线索:接口(interface)签名为:

IEnumerable<MyClass> GetThings(out string errMsg);

其中 MyClass 被定义为 Serializable,并且定义在客户端和服务器之间是相同的。

知道我需要拨动哪些 secret 开关吗?

最佳答案

WCF 还需要有具体类 来传递数据(因为它都需要是 XML 序列化的,并且必须能够在 XML 模式中表达——接口(interface)不太适合)。

我相信它无法传回 IEnumerable<T> - 尝试使用 List<T> (或 T[] 数组)或具体类型。

运气好吗?

关于c# - WCF Web 服务错误 : "Service endpoint binding not using HTTP protocol"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5310369/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com