PDA

View Full Version : onethumb - HELP !!!!


devbobo
Feb-09-2005, 01:51 AM
Don,

I'm trying to write some code for Mozilla, and I have found that when using Smugmug's api, i get some weird results.

I was running some test code, works fine on some other xml-rpc sites, but when I ran it on smugmug, I found that the code always reported 'Error: Server reported status 200'. Which when I looked it up, i was surprised that 200 == OK.

So I did some digging in the nsXmlrpcClient.js file and found the offending piece of code...

if (!e.target.responseXML) {
if (e.target.status) {
try {
parent._listener.onError(parent, parent._context, Components.results.NS_ERROR_FAILURE, 'Server returned status ' + e.target.responseText);
[snip]...


so what I find is that even though a status of 200 was returned, the XML-RPC responseXML is empty. I did some more checking and find that the XML-RPC responseText has the text version of the responseXML.

so i could easily change the code to look at the responseText instead of responseXML, but my problem is that this file is code provided by Firefox and I really don't want to be modifying if possible.

Is it possible to check why smugmug isn't returning the responseXML.

Thanks,

David

flyingpylon
Feb-09-2005, 07:16 AM
This is interesting.... I developed a web app using ASP/VBScript and ran into a similar problem. When I tried to use responseXML it was always empty, but when I used responseText and loaded that back into another XML object it would work fine. I'm not very experienced with XML-RPC, and smugmug's API is the first I've tried, so I figured it was something I was doing wrong.

devbobo
Feb-10-2005, 02:11 PM
Hi flypylon, yeah I could easily fix it...which I have temporarily, but unfortunately with Firefox, the component I had to modify was a source file that comes with the browser.

David

onethumb
Feb-11-2005, 12:58 PM
Don,

I'm trying to write some code for Mozilla, and I have found that when using Smugmug's api, i get some weird results.

I was running some test code, works fine on some other xml-rpc sites, but when I ran it on smugmug, I found that the code always reported 'Error: Server reported status 200'. Which when I looked it up, i was surprised that 200 == OK.

So I did some digging in the nsXmlrpcClient.js file and found the offending piece of code...

if (!e.target.responseXML) {
if (e.target.status) {
try {
parent._listener.onError(parent, parent._context, Components.results.NS_ERROR_FAILURE, 'Server returned status ' + e.target.responseText);
[snip]...


so what I find is that even though a status of 200 was returned, the XML-RPC responseXML is empty. I did some more checking and find that the XML-RPC responseText has the text version of the responseXML.

so i could easily change the code to look at the responseText instead of responseXML, but my problem is that this file is code provided by Firefox and I really don't want to be modifying if possible.

Is it possible to check why smugmug isn't returning the responseXML.

Thanks,

David

Hmm, I just made some changes on our test server that might alleviate this.

On our next feature rollout (soon, I hope, but you never know) we'll see if it works. :)

Don

devbobo
Feb-11-2005, 11:50 PM
Thanks,

David

onethumb
Feb-12-2005, 04:57 PM
Hmm, I just made some changes on our test server that might alleviate this.

On our next feature rollout (soon, I hope, but you never know) we'll see if it works. :)

Don

It's out, can you try and see if it works better?

Thanks,

Don

flyingpylon
Feb-12-2005, 06:52 PM
It's out, can you try and see if it works better?

Thanks,

Don
The problem I described earlier now appears to be fixed... thanks Don!

devbobo
Feb-13-2005, 03:12 PM
Thanks Don



It's out, can you try and see if it works better?

Thanks,

Don