Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/288.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用异步方法调用Xignite_C#_Silverlight_Browser - Fatal编程技术网

C# 使用异步方法调用Xignite

C# 使用异步方法调用Xignite,c#,silverlight,browser,C#,Silverlight,Browser,嗨,我有下面的代码,我正在尝试调用xignite中的一些历史数据。在本例中,xyz库是一个xignite库 //fire an event GetHistoricalQuotesAsOfCompleted proxy.GetHistoricalQuotesAsOfCompleted += new EventHandler<GetHistoricalQuotesAsOfCompletedEventArgs>(Ge

嗨,我有下面的代码,我正在尝试调用xignite中的一些历史数据。在本例中,xyz库是一个xignite库

 //fire an event GetHistoricalQuotesAsOfCompleted
                proxy.GetHistoricalQuotesAsOfCompleted +=
                    new EventHandler<GetHistoricalQuotesAsOfCompletedEventArgs>(GetHistoricalQuotesAsOfCompleted);

                //asynchronously request quotes for a time period
                proxy.GetHistoricalQuotesAsOfAsync(ticker, xyz.IdentifierTypes.Symbol,
                    DateTime.Now.ToString(), PeriodTypes.Day, days);

我发现实现这一点的最佳方法不是通过SOAP,而是在后端使用REST,然后解析返回的JSON。

下面是一个用于REST调用的Xignite URL示例,类似于返回JSON的原始问题:

如果您想要XML或CSV,只需在上面的URL中替换“.XML”或“.CSV”

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; GTB6; EasyBits GO v1.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.21022; .NET CLR 3.5.30729; MDDR; InfoPath.2; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E)
Timestamp: Wed, 6 Jul 2011 02:50:12 UTC


Message: Unhandled Error in Silverlight Application Object reference not set to an instance of an object.   at newAmStockChart.MainPage.GetHistoricalQuotesAsOfCompleted(Object sender, GetHistoricalQuotesAsOfCompletedEventArgs e)
   at newAmStockChart.xyz.XigniteHistoricalSoapClient.OnGetHistoricalQuotesAsOfCompleted(Object state)
Line: 1
Char: 1
Code: 0
URI: http://localhost:60260/newAmStockChartTestPage.aspx


Message: Unhandled Error in Silverlight Application Object reference not set to an instance of an object.   at newAmStockChart.MainPage.GetHistoricalQuotesAsOfCompleted(Object sender, GetHistoricalQuotesAsOfCompletedEventArgs e)
   at newAmStockChart.xyz.XigniteHistoricalSoapClient.OnGetHistoricalQuotesAsOfCompleted(Object state)
Line: 1
Char: 1
Code: 0
URI: http://localhost:60260/newAmStockChartTestPage.aspx