Closed Bug 358529 Opened 18 years ago Closed 18 years ago

Error attempting to use nsXmlRpcClient::asyncCall in an extension

Categories

(Firefox :: Extension Compatibility, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 355151

People

(Reporter: kraken, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0

I have an extension which uses the nsXmlRpcClient interface to make XML-RPC calls to a remote server.  When it attempts to actually make the call (asyncCall()), nsXmlRpcClient throws an exception, saying "XMLHttpRequest is not defined" on line 167 of nsXmlRpcClient.js.  This line contains:

this.xmlhttp = new XMLHttpRequest();

Changing this line to:

this.xmlhttp = createInstance(XMLHTTPREQUEST_CONTRACTID, 'nsIXMLHttpRequest');

Allows the call to complete as expected.

Reproducible: Always

Steps to Reproduce:
1. Make a simple extension which attempts to use the nsXmlRpcClient class
2. When the nsXmlRpcClient::asyncCall method is used, an exception is thrown.


Actual Results:  
The asyncCall method throws an exception when trying to create a new XMLHttpRequest.

Expected Results:  
The asyncCall method doesn't throw an exception when trying to create a new XMLHttpRequest

*** This bug has been marked as a duplicate of 355151 ***
Status: UNCONFIRMED → RESOLVED
Closed: 18 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.