Hi,
I am trying to call a sample webservice which is available for free.
I created web reference for Live search web service. and created this function ( below) :
public void DisplayWebServiceResults()
{
try
{
SearchL.
BingService service = new ExcelWorkbook2.net.live.search.api.BingService();
SearchL.
SearchRequest reqParam = new ExcelWorkbook2.net.live.search.api.SearchRequest();
reqParam.AppId =
"XXXX";
reqParam.Sources =
new ExcelWorkbook2.net.live.search.api.SourceType[] { SearchL.SourceType.Weather };
reqParam.Query =
"New";
System.Net.
IWebProxy P = new System.Net.WebProxy(http://X.X.X.X);
service.Proxy = P;
SearchL.
SearchResponse respParam = service.Search(reqParam);
Tools.
NamedRange range = (Tools.NamedRange)this.Controls["Data"];
range.Clear();
((Excel.
Range)range.Cells[1, 1]).Value2 = respParam.ToString();
}
catch (Exception e1)
{}
}
I am creating Ribbon (Visual designer) and I created a button. In the button click event I said :
Globals.Sheet1.DisplayWebServiceResults();
Even then, when I click the button, it is not working. It is getting struck after the service object is created for Bing service.
This is an urgent requirement. I am not able to figure out the issue. Can you please help me fix this issue.
Bookmarks