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

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

问题描述



现在我将Web服务移到了一个Web服务器,并且我正在 http://mydomain.com:8005。打开一个Web浏览器到该URL显示预期的服务页面,如果我在我正在调用的接口中的服务器上放置一个断点,它会触发断点并返回预期的数据...但在客户端它返回出现以下错误:


收到HTTP响应 http://mydomain.com:8005/ 。这可能是由于服务端点绑定不使用HTTP协议。这也可能是由于服务器中断了HTTP请求上下文(可能由于服务关闭)。有关详细信息,请参阅服务器日志。


更多线索:界面签名是:

 的IEnumerable< MyClass的> GetThings(out string errMsg); 

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



任何想法什么秘密交换机需要翻转?

解决方案

WCF还需要具有具体类来传递数据(因为它们都需要是XML可序列化的,并且必须能够在XML模式中表示 - 接口aren非常适合)。



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



任何运气?


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

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:

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);

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 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).

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.

Any luck?

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

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