Skip to content

Instantly share code, notes, and snippets.

@saga
Created July 5, 2011 14:57
Show Gist options
  • Save saga/1064999 to your computer and use it in GitHub Desktop.
Save saga/1064999 to your computer and use it in GitHub Desktop.
wcf client using WSHttpBinding and Channel
public string HelloWorld()
{
// workable
WSHttpBinding binding = new WSHttpBinding();
EndpointAddress address = new EndpointAddress("http://localhost:8732/Design_Time_Addresses/WcfServiceLibrary1/Service1/");
IService1 proxy = ChannelFactory<IService1>.CreateChannel(binding, address);
using (proxy as IDisposable)
{
proxy.GetData(99);
}
Service1Client client = new Service1Client("WSHttpBinding_IService1");
string ret = client.GetData(99);
return ret;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment