WCF Web服务的错误:"不使用HTTP协议&QUOT服务端点绑定;? [英] WCF Web Service error: "Service endpoint binding not using HTTP protocol"?

查看:161
本文介绍了WCF Web服务的错误:"不使用HTTP协议&QUOT服务端点绑定;?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有已经工作得很好,而我一直在测试我的开发机器简单的WCF服务。

I've got a simple WCF service that has worked fine while I've been testing on my dev machine.

现在我搬到Web服务到Web服务器,而我在 HTTP运行的服务(在调试模式):// MYDOMAIN .COM:8005 。打开Web浏览器的URL显示了预期的服务页面,如果我把一个断点,我打电话界面内的服务器上,它击中断点,并返回预期的数据...但在客户端上它回来并出现以下错误:

Now I've moved the web service to a web server, and I'm running the service (in debug mode) at http://mydomain.com:8005. Opening a web browser to that URL shows the expected service page, and if I put a breakpoint on the server inside the interface I'm calling, it hits the breakpoint and returns the expected data... but on the client side it comes back with the following error:

在接收HTTP响应 http://mydomain.com:8005/ 发生错误。这可能是由于服务端点未使用HTTP协议绑定。这也可能是由于一个HTTP请求上下文被中止的服务器(可能是由于该服务正在关闭)。请参阅服务器日志的更多细节。

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.

更多的线索:接口签名是:

More clues: the interface signature is:

IEnumerable<MyClass> GetThings(out string errMsg);

其中, MyClass的被定义为可序列化,以及定义客户端和服务器之间是相同的。

where MyClass is defined as Serializable, and the definitions are identical between client and server.

任何想法,我需要翻转着怎样的秘密开关?

Any ideas what secret switches I need to flip?

推荐答案

WCF也需要有的具体类是传递数据(因为这一切必须是XML序列化的,并且必须能够被pssed在XML模式前$ P $ - 接口不适合)。

WCF also needs to have concrete classes to pass data around (since it all needs to be XML-serializable and must be capable of being expressed in XML schema - interfaces aren't well suited).

我相信这将无法传回一个的IEnumerable&LT; T&GT; - 尝试使用名单,其中,T&GT; (或 T [] 阵列)或一个具体类型代替。

I believe it won't be able to pass back an IEnumerable<T> - try using a List<T> (or an T[] array) or a concrete type instead.

任何运气?

这篇关于WCF Web服务的错误:&QUOT;不使用HTTP协议&QUOT服务端点绑定;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆