nsIXmlRpcClient

IID:37127241-1e6e-46aa-ba87-601d41bb47df
Inherits From:nsISupports

This interface is implemented by the following components:


Constants

PRUint32 INT = 1
PRUint32 BOOLEAN = 2
PRUint32 STRING = 3
PRUint32 DOUBLE = 4
PRUint32 DATETIME = 5
PRUint32 ARRAY = 6
PRUint32 STRUCT = 7

Properties

readonly nsIXmlRpcFault fault

The most recent XML-RPC fault from returned from this server. null if the last call didn't return an XML-RPC fault.

readonly PRBool inProgress

Wether or not a call is in progress

readonly PRUint32 responseStatus

The most recent HTTP status code returned from this server null if the server was unreachable or not yet contacted.

readonly PRUint32 responseString

readonly nsISupports result

The most recent XML-RPC call result returned from this server. null if the last call didn't return a valid result

readonly nsIURL serverURL

The URL of the XML-RPC server


Methods

void asyncCall ( nsIXmlRpcClientListener listener , nsISupports ctxt , char* methodName , nsISupports arguments , PRUint32 count ) void clearAuthentication ( char* username , char* password ) void createType ( PRUint32 type , out nsIIDRef uuid , retval nsQIResult* result ) void init ( char* serverURL ) void setAuthentication ( char* username , char* password )

void asyncCall ( nsIXmlRpcClientListener listener , nsISupports ctxt , char* methodName , nsISupports arguments , PRUint32 count )

Call remote method methodName asynchronously with given arguments.

Supported arguments are: nsISupportsPRUint8, nsISupportsPRUint16, nsISupportsPRInt16, nsISupportsPRInt32: nsISupportsPRBool: nsISupportsChar, nsISupportsCString: nsISupportsFloat, nsISupportsDouble: nsISupportsPRTime: nsIInputStream: nsISupportsArray: nsIDictionary:

Note that both nsISupportsArray and nsIDictionary can only hold any of the supported input types.

Return value will be converted as follows: or : nsISupportsPRInt32 : nsISupportsPRBool : nsISupportsCString : nsISupportsDouble : nsISupportsPRTime : nsISupportsCString : nsISupportsArray : nsIDictionary

s (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.

Arguments:
listener: A nsIXmlRpcClientListener that will get notified of XML-RPC events.
ctxt
methodName: Remote method to call.
arguments: Array of arguments to pass to remote method.
count
Returns:
Return value of remote method.

void clearAuthentication ( char* username , char* password )

Clear authentication info.

Arguments:
username
password

void createType ( PRUint32 type , out nsIIDRef uuid , retval nsQIResult* result )

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.

Arguments:
type: One of the listed constants.
uuid: The uuid of the returned object. No QI call needed.
result

void init ( char* serverURL )

Set server URL. Call this before using this object.

Arguments:
serverURL: URL of server side object on which methods should be called.

void setAuthentication ( char* username , char* password )

Set authentication info if needed. Both parameters must be specified for authentication to be enabled.

Arguments:
username: username to be used if asked to authenticate
password: password to be used if asked to authenticate

References

This interface is passed as an argument to the following methods:

nsIXmlRpcClientListener.onError, nsIXmlRpcClientListener.onFault, nsIXmlRpcClientListener.onResult

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com