|
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using Rashim.RND.WCF.ConfigurationModel.Services;
namespace Rashim.RND.WCF.ConfigurationModel.Client
{
class Program
{
static void Main(string[] args)
{
var binding = new WSHttpBinding();
binding.MessageEncoding=WSMessageEncoding.Mtom;
var endpointAddress = new EndpointAddress("http://localhost/http");
var proxy = ChannelFactory<IMessageService>.CreateChannel(binding,endpointAddress);
Console.WriteLine(proxy.GetMessage("HTTP:It is working"));
Console.WriteLine("\n\n");
var bindingNetTcp = new NetTcpBinding();
var endpointAddressNetTcp = new EndpointAddress("net.tcp://localhost/netTCP");
var proxyNetTcp = ChannelFactory<IMessageService>.CreateChannel(bindingNetTcp, endpointAddressNetTcp);
Console.WriteLine(proxyNetTcp.GetMessage("NetTCP:It is working"));
Console.ReadLine();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.