Generated Proxy Classes defaultSucceededCallback Property
Gets or sets the default succeeded callback function for the generated proxy class and its instances. This property exists at run time after the proxy class has been generated by the server.
Note
To get or set property values for client API properties, you must call property accessor methods that are named with the get_ and set_ prefixes. For example, to get or set a value for a property such as cancel, you call the get_cancel or set_cancel methods.
// Syntax for the generated proxy class.
var succeededCallback = MyNameSpace.MyServiceProxy.get_defaultSucceededCallback();
MyNameSpace.MyServiceProxy.set_defaultSucceededCallback(handler);
// Syntax for a proxy instance.
var succeededCallback = myServiceProxy.get_defaultSucceededCallback();
myServiceProxy.set_defaultSucceededCallback(handler);
Parameters
Parameter |
Description |
---|---|
handler |
The succeeded callback function. |
Return Value
The succeeded callback function, if set; otherwise, null.
Remarks
The succeeded callback function is invoked when a call to a Web service method has finished successfully.
The succeeded callback function can be passed as a parameter during any call to a Web service method. If you pass a succeeded callback function when you call a Web service method, the passed function overrides the function that is set by using the defaultSucceededCallback property.
Example
The following example shows how to set and get the defaultSucceededCallback property for the generated proxy class and for a proxy instance.
// This function sets and gets the default succeeded
// callback function for the Web service generated
// proxy class.
function AssignSucceededCallback()
{
// Set the default callback.
Samples.AspNet.UsingProxyClass.set_defaultSucceededCallback(SucceededCallback);
// Get the default callback.
var callback =
Samples.AspNet.UsingProxyClass.get_defaultSucceededCallback();
// Display the callback.
DisplayMessage(callback);
}
// This function sets and gets the default succeeded
// callback function for an instance of the Web service
// generated proxy class.
function AssignInstanceSucceededCallback()
{
// Create an instance of the proxy class.
var proxyInstance =
new Samples.AspNet.UsingProxyClass();
// Set the default callback.
proxyInstance.set_defaultSucceededCallback(SucceededCallback);
// Get the default callback.
var callback = proxyInstance.get_defaultSucceededCallback();
// Display the callback.
DisplayMessage(callback);
}
See Also
Reference
Generated Proxy Classes defaultUserContext Property
Generated Proxy Classes defaultFailedCallback Property