【发布时间】:2010-11-19 22:35:52
【问题描述】:
我有我的 wcf 服务,它运行良好。 然后我试图从我的 asp.net 应用程序连接到该服务。一切正常,服务中收到来自asp.net的请求(因为我可以调试代码),然后当它返回客户端时出现以下错误:
The underlying connection was closed: The connection was closed unexpectedly
我的WCF服务合同如下:
[OperationContract()]
WCFResponseGetAllProducts GetAllProducts(WCFRequestGetAllProducts request);
而 WCFResponseGetAllProducts 、 WCFRequestGetAllProducts 类具有 [DataContract] 属性。这些类的成员具有 [DataMember] 属性。
但是,当我在合同中添加另一种方法时:
[OperationContract()]
int Test();
然后我可以毫无问题地从 asp.net mvc 应用程序执行它。有人可以帮帮我吗? PS。我目前在 Visual Studio 2010 的默认 Web 服务器中托管我的 wcf 服务
【问题讨论】:
标签: asp.net-mvc wcf