![](/img/trans.png)
[英]Retrieving Navigation Properties through WebGet method in WCF Data Service
[英]Retrieving online data with a wcf service
我面臨一個小問題,希望您能找到解決方案。 我正在使用wcf服務來檢索在線數據(從Yahoo Finance)。 該服務調用一個連接到yahoo的API,以檢索我需要的數據。 但是,當我調用API時,出現錯誤
WebClient
請求期間發生異常。
我正在從控制台應用程序調用此服務。
希望您能為我解決這個問題。
==這是代碼
/* wcf service Interface */
[ServiceContract]
public interface IService1
{
[OperationContract]
string GetData(int value);
// TODO: Add your service operations here
}
/* the service calls this function which belongs to another c# project */
public String updateDataBase()
{
DBHandler handler = new DBHandler();
/* Goes online et retrieve the data, when its called, the exception occurs */
handler.updateData();
return "success";
}
我通過以管理員身份運行Visual Studio解決了我的問題。
謝謝。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.