CancelNotification
method is used to cancel an outstanding asynchronous call.
The following is an example for using CancelNotification
:
cancel_output = location_handle.call('CancelNotification', {'CancelRequestType': u'GetLocCancel'})
The following table summarizes the specification of CancelNotification
:
Interface | ILocation |
Description | Cancels the registered listeners with the service provider. |
Response Model | Synchronous |
Pre-condition | Device must be Location aware (that is, it must have some location service provider in form of GPS, AGPS, or Bluetooth). ILocation interface loaded. |
Post-condition | Nil |
Input Parameters
The parameters specify whether to cancel a GetList
call or a Trace
call. The object must contain the CancelRequestType
property (unicode string) that is used to specify the type of call to cancel.
|
Output Parameters
Output parameters contain ErrorCode
, and ErrorMessage
if the operation fails.
|
Errors
The following table lists the error codes and their values:
|
Error Messages
The following table lists the error messages and their description:
|
Example
The following sample code illustrates how to cancel the registered listeners with the service provider:
import scriptext location_handle = scriptext.load('Service.location', 'ILocation') try: cancel_output = location_handle.call('CancelNotification', {'CancelRequestType': u'GetLocCancel'}) errorcode = cancel_output["ErrorCode"] if errorcode != 0: print "Error in cancelling the request" else: ret_val = cancel_output["ReturnValue"] print "The cancellation request is successful" except scriptext.ScriptextError, err: print "Error performing the operation : ", err
See About this document... for information on suggesting changes.