WCF热门问题编程示例(1):WCF服务如何获得客户端地址信息
1个回答
展开全部
//通过代理调用SayHelloToUser服务
strMessage =wcfServiceProxyHttp.SayHelloToUser(strUserName);
Console.WriteLine(strMessage);
}
//2.NetTcpBinding_IWCFService
using (WCFServiceClient wcfServiceProxyHttp = new WCFServiceClient(WSHttpBinding_IWCFService))
{
string strUserName = Frank Xu Lei NetTcpBinding ;
string strMessage = ;
//通过代理调用SayHelloToUser服务
strMessage = wcfServiceProxyHttp.SayHelloToUser(strUserName);
Console.WriteLine(strMessage);
}
//3.BasicHttpBinding_IWCFService
using (WCFServiceClient wcfServiceProxyHttp = new WCFServiceClient(WSHttpBinding_IWCFService))
{
string strUserName = Frank Xu Lei BasicHttpBinding ;
string strMessage = ;
//通过代理调用SayHelloToUser服务
strMessage = wcfServiceProxyHttp.SayHelloToUser(strUserName);
Console.WriteLine(strMessage);
}
//4.WSDualHttpBinding_IWCFService,
using (WCFServiceClient wcfServiceProxyHttp = new WCFServiceClient(WSHttpBinding_IWCFService))
{
strMessage =wcfServiceProxyHttp.SayHelloToUser(strUserName);
Console.WriteLine(strMessage);
}
//2.NetTcpBinding_IWCFService
using (WCFServiceClient wcfServiceProxyHttp = new WCFServiceClient(WSHttpBinding_IWCFService))
{
string strUserName = Frank Xu Lei NetTcpBinding ;
string strMessage = ;
//通过代理调用SayHelloToUser服务
strMessage = wcfServiceProxyHttp.SayHelloToUser(strUserName);
Console.WriteLine(strMessage);
}
//3.BasicHttpBinding_IWCFService
using (WCFServiceClient wcfServiceProxyHttp = new WCFServiceClient(WSHttpBinding_IWCFService))
{
string strUserName = Frank Xu Lei BasicHttpBinding ;
string strMessage = ;
//通过代理调用SayHelloToUser服务
strMessage = wcfServiceProxyHttp.SayHelloToUser(strUserName);
Console.WriteLine(strMessage);
}
//4.WSDualHttpBinding_IWCFService,
using (WCFServiceClient wcfServiceProxyHttp = new WCFServiceClient(WSHttpBinding_IWCFService))
{
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询