SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 96 | Next

Robin Pars, Laurence Moroney, and John Grieb

"Foundations of ASP.NET AJAX"

In this case, the web method is named getCarValue, and the service is called CarService,
so the method that needs to be called is CarService.getCarValue. If the web service is
defined within a namespace, then the name of the method would be prefixed by the
namespace (e.g., if the namespace is MyServicesForAjaxApps, then the method name
would be MyServicesForAjaxApps.CarService.getCarValue). If you are in doubt as to what
to use, then look at the value of the Class attribute in the web service??™s .asmx file (see the
<%@ WebService %> attribute at the start of the .asmx file) and use that appended with the
name of the web method.
Now, the getCarValue web method only expects three parameters, but we??™ve passed five
parameters into the web service proxy. Because the AJAX Library invokes web services
asynchronously, it needs to inform you when the call to the web service is complete.
The two additional parameters are the names of the methods to call if the web service
call completes successfully and the method to call if it fails. In this case, the function
onComplete will be called if the web service call completes successfully, and the function
onError will be called if there is a problem calling the web service.


Pages:
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108