Click the Add Reference
button to generate the proxy class for the web service.
CHAPTER 10 ?– BUILDING A SAMPLE APPLICATION USING ASP.NET AJAX 233
Figure 10-6. Specifying the WSDL
The Company Information web service is used in the application to present the
name of the company as well as the current price information. Now there needs to be a
method called GetCompanyInfo in which we write the code to use a few of the properties
to get the actual company data. After that, this information needs to be assigned to the
lblQuote control as shown in the following code snippet:
private void GetCompanyInfo(string strTicker)
{
companyInfo.CompanyInfoService service = new
companyInfo.CompanyInfoService();
companyInfo.CompanyInfoResult result = service.doCompanyInfo("anything",
"anything", strTicker);
lblQuote.Text = result.company + "
Current Price: " + result.lastPrice
+ "
Change: " +result.change;
}
This function updates the company information pane as well as the price history text
and graphs. Also, because this is the one piece of information that does not reside within
the tabs, it should be rendered and updated without the user clicking on the individual
tabs.
Pages:
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327