【发布时间】:2012-04-13 11:06:10
【问题描述】:
我创建了一个多端点 WCF 服务并使用它,它工作正常。
但是当我尝试关闭服务客户端时,出现错误。
这就是我创建客户端对象并为单端点 WCF 服务处理其工作正常的方式
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
ICardPrintingService Service = null;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Service = new CardPrintingServiceClient();
var response = this.Service.GetCardData(new GetCardDataRequest { NIK = 6666620501740003 });
try
{
((CardPrintingServiceClient)Service).Close();
}
catch (Exception ex)
{
MessageBox.Show("error");
}
}
}
}
当关闭连接并显示错误消息时,这将进入 catch 块
远程端点不再识别此序列。这是最 可能是由于远程端点上的中止。的价值 wsrm:Identifier 不是已知的序列标识符。可靠的 会话出错。
谁能告诉我为什么?
非常感谢广告
拉格哈文德拉
【问题讨论】: