异常信息
向 ChannelFactory 提供的 InstanceContext 包含未实现 CallbackContractType“CT_CLIENT.ClientProxy.IServiceCallback”的 UserObject。Host 端信息namespace IE_SERVICE
{
public interface IClientCallBack
{
[OperationContract(IsOneWay = true)]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(object[]))]
void SendInfo(CN_MODEL.Info info); [OperationContract(IsOneWay = true)]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(object[]))]
void UpdateCurRefreshTime(int id, int curRefreshCount, DateTime curRefreshTime, string content,int userid); [OperationContract(IsOneWay = true)]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(object[]))]
void CloseSameClient(); }
}
namespace IE_SERVICE
{
[ServiceContract(SessionMode = SessionMode.Required, CallbackContract = typeof(IClientCallBack))]
public interface IService
{
[OperationContract]
string GetCityId(string cityName, object[] obj);
}
}
客户端实现:
namespace CT_CLIENT
{
public partial class Form2 : FrmBase, IE_SERVICE.IClientCallBackpublic void SendInfo(Info info)
{
//具体代码
}public void UpdateCurRefreshTime(int id, int curRefreshCount, DateTime curRefreshTime, string content, int userid)
{
//具体代码
}
public void CloseSameClient()
{
//具体代码 }private void bttrial_Click(object sender, EventArgs e)
{
string cId = Proxy.GetCityId("郑州");//在这里出错
}
}public static ProxyFacade Proxy
{
get
{
if (proxy == null)
{
//proxy = new ProxyFacade(new InstanceContext(new FrmMain()));
proxy = new ProxyFacade(new InstanceContext(proxyObj));
return proxy;
}
else
{
return proxy;
}
}
}
public ProxyFacade(InstanceContext callback)
{
if (proxy == null)
proxy = new ClientProxy.ServiceClient(callback);
else
{
proxy.Abort();
proxy.Close();
proxy = null;
proxy = new ClientProxy.ServiceClient(callback);
} }
求高手指点一二 或QQ联系:564473594,不胜感激
向 ChannelFactory 提供的 InstanceContext 包含未实现 CallbackContractType“CT_CLIENT.ClientProxy.IServiceCallback”的 UserObject。Host 端信息namespace IE_SERVICE
{
public interface IClientCallBack
{
[OperationContract(IsOneWay = true)]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(object[]))]
void SendInfo(CN_MODEL.Info info); [OperationContract(IsOneWay = true)]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(object[]))]
void UpdateCurRefreshTime(int id, int curRefreshCount, DateTime curRefreshTime, string content,int userid); [OperationContract(IsOneWay = true)]
[System.ServiceModel.ServiceKnownTypeAttribute(typeof(object[]))]
void CloseSameClient(); }
}
namespace IE_SERVICE
{
[ServiceContract(SessionMode = SessionMode.Required, CallbackContract = typeof(IClientCallBack))]
public interface IService
{
[OperationContract]
string GetCityId(string cityName, object[] obj);
}
}
客户端实现:
namespace CT_CLIENT
{
public partial class Form2 : FrmBase, IE_SERVICE.IClientCallBackpublic void SendInfo(Info info)
{
//具体代码
}public void UpdateCurRefreshTime(int id, int curRefreshCount, DateTime curRefreshTime, string content, int userid)
{
//具体代码
}
public void CloseSameClient()
{
//具体代码 }private void bttrial_Click(object sender, EventArgs e)
{
string cId = Proxy.GetCityId("郑州");//在这里出错
}
}public static ProxyFacade Proxy
{
get
{
if (proxy == null)
{
//proxy = new ProxyFacade(new InstanceContext(new FrmMain()));
proxy = new ProxyFacade(new InstanceContext(proxyObj));
return proxy;
}
else
{
return proxy;
}
}
}
public ProxyFacade(InstanceContext callback)
{
if (proxy == null)
proxy = new ClientProxy.ServiceClient(callback);
else
{
proxy.Abort();
proxy.Close();
proxy = null;
proxy = new ClientProxy.ServiceClient(callback);
} }
求高手指点一二 或QQ联系:564473594,不胜感激
解决方案 »
- datatable 生成XML
- 关于listView问题
- Win API函数的数据类型在C#中怎么表示 ?
- 在c#中Dataset1.xsd如何使用
- 怎么在按ALT+TAB 的时候隐藏我的from
- 客户端POST数据到服务器某aspx
- c#的初学者,问个问题先关于文件的上传和下载的
- 有关ASP.NET(C#)操作数据库的问题
- 谁用NETSerialComm做过异步调用的例子?100分
- 关于提取HTml的正则表达式
- SqlBulkCopy 支持Access数据库吗?
- WCF双工通信问题: 向 ChannelFactory 提供的 InstanceContext 包含未实现 CallbackContractType
嗨,哥们你是在解决的啊?给个解决方法呗。