public static void TestRESTUsingWebChannelFactory() { //1) consuming the REST based service WebChannelFactory <ISOAPRESTDemo> cf = new WebChannelFactory <ISOAPRESTDemo>(new Uri(serviceUrlREST)); ISOAPRESTDemo client = cf.CreateChannel(); PrintSuccessMessage(client.EchoWithGet(message), client.EchoWithPost(message)); }
public static void TestSOAPUsingChannelFactory() { //2) consuming SOAP with channel factory using (ChannelFactory <ISOAPRESTDemo> scf = new ChannelFactory <ISOAPRESTDemo>(new BasicHttpBinding(), serviceUrlSOAP)) { ISOAPRESTDemo channel = scf.CreateChannel(); PrintSuccessMessage(channel.EchoWithGet(message), channel.EchoWithPost(message)); } }