The simplest example you can imagine (but maybe not the most fanciful...):
Passing parameters to the Web Service (see also DEMO 12):
Using a date as return type (.NET "DateTime" automatically converted to JavaScript "Date")
Calling a void method with a long response-time (while waiting for the response an orange box is displayed):
Handling exceptions:
Syncronous call example: server response is delayed 5 seconds using "Wait" method (see demo No. 4). Please note that browser is stuck until response is received:
Leaving the textbox empty, the web method will return a null; entering any value a User object with random property values will be returned:
Using custom entity arrays. The web method returns an array with 4 User objects (see demo No. 7)
Custom entity collection (System.Collections.ICollection). The web method returns a UserList object, typed collection of User (see demo No. 7) with 3 elements.
Fill options with AJAX:
How to use the SOAP response (XmlDocument) in callback method. In this example we show only the Xml in an alertbox, but you can - for example - transform the SOAP response using a stylesheet (XSL).
Passing complex parameters to the Web Service
Example #1: string, int, float, bool, Date
Example #2: string[]
Example #3: int[]
Example #4: User (custom object)
Example #5: User[] (custom object list)