Created
July 5, 2011 14:57
-
-
Save saga/1064999 to your computer and use it in GitHub Desktop.
wcf client using WSHttpBinding and Channel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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