【发布时间】:2013-06-03 16:26:03
【问题描述】:
我做了以下自定义方法
[WebGet]
public string GetAllCars()
{
return "hello";
}
我正在从浏览器中使用此功能,它工作正常 但是当我通过服务引用执行方法通过网络应用程序消费时 它运行良好但通过快速观看无法看到结果,查询操作响应在那里但不知道如何从结果中获取字符串
代码如下:
ServiceReference1.SampleDBEntities uricontext = new ServiceReference1.SampleDBEntities(new Uri("http://localhost/website2/wcfservice1.svc"));
uricontext.Credentials = System.Net.CredentialCache.DefaultCredentials;
var proxycontext = uricontext.Execute<String>(new Uri("http://localhost/website2/wcfdataservice1.svc/GetAllCars"));
【问题讨论】: