Obsolete
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
Inherits from: nsISupports
void init(in string serverURL); |
void setAuthentication(in string username, in string password); |
void clearAuthentication(in string username, in string password); |
void setEncoding(in string encoding); |
void setEncoding(in unsigned long type, out nsIIDRef uuid, out nsQIResult result); |
void asyncCall (in nsIXmlRpcClientListener listener, in nsISupports ctxt, in string methodName, in nsISupports arguments, in PRUInt32 count); |
Attribute | Type | Description |
serverURL | readonly nsIURL | The URL of the XML-RPC server |
inProgress | readonly boolean | Whether or not a call is in progress |
fault | readonly nsIXmlRpcFault | The most recent XML-RPC fault from returned from this server. null if the last call didn't return an XML-RPC fault. |
result | readonly nsISupports | The most recent XML-RPC call result returned from this server. null if the last call didn't return a valid result. |
responseStatus | readonly unsigned long | The most recent HTTP status code returned from this server. null if the server was unreachable or not yet contacted. |
responseString | readonly unsigned long | The most recent HTTP status code returned from this server. null if the server was unreachable or not yet contacted. |
Constant | Type | Description |
INT | unsigned long | nsISupportsPRInt32 |
BOOLEAN | unsigned long | nsISupportsPRBool |
STRING | unsigned long | nsISupportsCString |
DOUBLE | unsigned long | nsISupportsDouble |
DATETIME | unsigned long | nsISupportsPRTime |
ARRAY | readonly unsigned long | nsISupportsArray |
STRUCT | readonly unsigned long | nsISupportsDictionary |
Set server URL. Call this before using this object
void getData ( in string serverURL ) ;
serverURL
Set authentication info if needed. Both parameters must be specified for authentication to be enabled
void setAuthentication ( in string username, in string password ) ;
username
password
Clear authentication info
void setAuthentication ( in string username, in string password ) ;
username
password
Set character encoding. The default charset if this function is not called is "UTF-8"
void setAuthentication ( in string encoding ) ;
encoding
Call remote method methodName asynchronously with given arguments.
Supported arguments are: nsISupportsPRUint8, nsISupportsPRUint16, nsISupportsPRInt16, nsISupportsPRInt32: i4, nsISupportsPRBool: boolean, nsISupportsChar, nsISupportsCString: string, nsISupportsFloat, nsISupportsDouble: double, nsISupportsPRTime: dateTime.iso8601, nsIInputStream: base64, nsISupportsArray: array, nsIDictionary: struct
Note that both nsISupportsArray and nsIDictionary can only hold any of the supported input types.
Return value will be converted as follows: i4 or int: nsISupportsPRInt32 boolean: nsISupportsPRBool string: nsISupportsCString double: nsISupportsDouble dateTime.iso8601: nsISupportsPRTime base64: nsISupportsCString array: nsISupportsArray struct: nsIDictionary
Faults (server side errors) are indicated by returning NS_ERROR_FAILURE. Via nsIXPConnect::GetPendingException()->data
a nsIXmlRpcFault object can be retreieved with more information on the fault.
listener
ctxt
methodName
arguments
count
void asyncCall ( in nsIXmlRpcClientListener listener, in nsISupports ctxt, in string methodName, [array, size_is(count)] in nsISupports arguments, in PRUint32 count );
Convenience: return the correct nsISupportsPrimitive for a given XML-RPC type, or nsISupportsArray or nsIDictionary. 'base64' isn't supported. No QueryInterface call is needed, the object has been QueryInterfaced to the correct interface.
void createType ( in unsigned long type, out nsIIDRef uuid, [iid_is(uuid),retval] out nsQIResult result ) ;
type
uuid
result