[Project_owners] XML-RPC trouble

David Murray lid2000 at tpg.com.au
Fri Apr 1 14:36:01 EST 2005


Okay, figured it out:

The nsXmlRpcClient.js file that ships with Firefox (in the components 
directory, dated 26/3/2003, version 1.33) hates me. It will launch 
errors when requests completed successfully and all sorts of things. If 
I overwrite this file with the version found at 
http://mozblog.mozdev.org/nsXmlRpcClient.js (dated 9/7/2003, version 
1.5), everything works perfectly fine.

So that seems to be that problem finally averted. Now my question is: 
how would I go about including this modified file with my extension? It 
won't load it from XUL (seems to get ignored and relies on old version 
in components dir), and I can't go getting people to overwrite stuff in 
their components directory. What would be the best way to include this? 
Rename the object, then reference that?

David.


Matthew Wilson wrote:
> I have to admit that when I read your email, I for some reason thought 
> you were using XMLHttpRequest. I have to confess to knowing nothing 
> about Mozilla's XMLRPC support, but here's three things that occurred to 
> me:
> 
> 1. The XMLRPC client is in pure JS, so you can easily edit it in the 
> browser components directory to add debug.
> 
> 2. What happens if you just do "window.alert (result)"?
> 
> 3. According to the LiveJournal documentation, the returned value is a 
> <struct>. Doesn't that mean that result should be an nsIDictionary?
> 
> Matthew
> 
> David Murray wrote:
> 
>> The missing stuff related to it is:
>>
>> dsLogin = new Object();
>>
>> dsLogin.xmlrpc = 
>> Components.classes["@mozilla.org/xml-rpc/client;1"].createInstance(Components.interfaces.nsIXmlRpcClient); 
>>
>>
>> Both those lines are outside any functions. dsAccounts.posturl is a 
>> string that = "http://www.livejournal.com/interface/xmlrpc"
>>
>> I checked with HTTPHeaders, and it seems to send the request fine, and 
>> formed right. I copied the request and sent it via HTTPeek to see what 
>> the exact response was, and the response is valid too. There is an 
>> object returned from the request (as you can see, the third parameter 
>> in RPCHandler.onResult); I just can't seem to read it or do anything 
>> useful with it at all.
>>
>> I'll post the code up tomorrow if I still can't figure it out, but I'm 
>> off to bed now, after 11 straight hours trying to figure this out. 
>> Goodnight all.
>>
>> David.
>>
>>
>> matthew at mjwilson.demon.co.uk wrote:
>>
>>> lid2000 at tpg.com.au wrote:
>>>
>>>> Yes, it's me again, this time with another stupid problem. It seems 
>>>> that every afternoon I find myself tearing my hair out for 7 hours 
>>>> over a different problem. I'm trying to communicate with LiveJournal 
>>>> via XML-RPC.
>>>
>>>
>>>
>>>
>>> There seems to be a lot of code missing from your sample. Can you 
>>> post a link to complete code?
>>>
>>> Also try installing LiveHttpHeaders and see what's actually being 
>>> sent and received.
>>>
>>> Matthew
>>> _______________________________________________
>>> Project_owners mailing list
>>> Project_owners at mozdev.org
>>> http://mozdev.org/mailman/listinfo/project_owners
>>>
>>>
>>>
>>>
>>
>> _______________________________________________
>> Project_owners mailing list
>> Project_owners at mozdev.org
>> http://mozdev.org/mailman/listinfo/project_owners
>>
> 
> 
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> http://mozdev.org/mailman/listinfo/project_owners
> 
> 
> 
> 



More information about the Project_owners mailing list