BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.None); IChannelFactory<irequestchannel> factory = binding.BuildChannelFactory<irequestchannel>(new BindingParameterCollection()); factory.Open(); EndpointAddress address = new EndpointAddress("http://localhost:2193/Service1.svc"); IRequestChannel irc = factory.CreateChannel(address); using (irc as IDisposable) { irc.Open(); XmlReader reader = XmlReader.Create(new StringReader( @"<getdatausingdatacontract xmlns="http://tempuri.org/"> <composite xmlns:a="http://schemas.datacontract.org/2004/07/"> xmlns:i='http://www.w3.org/2001/XMLSchema-instance'> <a:boolvalue>true</a:boolvalue> <a:stringvalue>test values</a:stringvalue> </composite> </getdatausingdatacontract>")); Message m = Message.CreateMessage(MessageVersion.Soap11, "http://tempuri.org/IService/GetDataUsingDataContract", reader); Message ret = irc.Request(m); reader.Close(); Console.WriteLine(ret); } //close the factory factory.Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)