|
Returning Complex Types
Listing 5. Complex types such as the Customer type returned from the CustomerService Web Service can be accessed directly on the client-side due to the proxy object created by the Script. This provides an easy way to access properties of an object. function GetCustomer()
{
var id = $get("txtCustomerID").value;
XmlForAsp.CustomerService.GetCustomer(id,OnWSGetCustomer);
}
function OnWSGetCustomer(result)
{
//Write out first name and last name of returned Customer object
$get("spanCustomerResult").innerHTML =
result.FirstName + " " + result.LastName;
}
|