我创建了一个 wcf 库,并有 1 个主机和 2 个客户端连接到它。
在我的 WCF 中,我有代码存储从客户端 A 发送到 WCF 的消息:
private string CustReady; //whether the customer is ready
我有一个为此设置的方法,如下
public string sendReady(string s_Ready)
{
CustReady = s_Ready;
}
//gets state of customer (POS)
public string getReady()
{
return CustReady;
}
客户端 A 使用 sendReady 方法并传入一个字符串,然后将其存储在 CustReady 中。在客户端 B 中,当单击按钮并检索保存在 CustReady 变量中的字符串时,会触发 getReady 方法。当我在我的 WCF 中围绕这两种方法设置断点时,客户端 A 正确存储了信息,但是当我按下客户端 B 上的按钮时,它返回 null。我想知道是否有人知道为什么?
谢谢