Last post Jan 12, 2014 08:19 AM by Fuxiang Zhang - MSFT
Jan 10, 2014 02:47 PM|np4|LINK
How do I call a WCF webservice using WebClient. Where do i specify the servcie URL and method to be called and PArameters passed?
Jan 12, 2014 08:19 AM|Fuxiang Zhang - MSFT|LINK
Thank you post the issue to asp.net forum.
This is a commeon issue, "WebClient Class Provides common methods for sending data to and receiving data from a resource identified by a service URL."
Lingaraj has provided a solution to consume WCF service (rest) like below code.
WebClient client = new WebClient ();
Stream data = client.OpenRead (http://www.dotnetperls.com/YourService.svc");
StreamReader reader = new StreamReader (data);
string s = reader.ReadToEnd ();
For more information, please check below issue.
Hope this helps, thanks.