This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Mozilla XML > May 2007 > xml-rpc is running in mozilla 0.9.1?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author xml-rpc is running in mozilla 0.9.1?
Alberto Berti

2007-05-10, 6:38 pm



Hi,

I tried the xml-rpc.xul testfile on mozilla 0.9.1 loaded from a
chrome:// url. When i press either the "Async" or the "Sync" button, the
function breaks and mozilla dumps an exception on the console:

Document chrome://test/content/xml-rpc.xul loaded successfully
Call Async
************************************************************
* Call to xpconnect wrapped JSObject produced this error: *
[Exception... "Could not convert JavaScript argument (NULL value
cannot be used for a C++ reference type) arg 0
[nsISupports.QueryInterface]" nsresult: "0x8057000b
(NS_ERROR_XPC_BAD_CONVERT_JS_NULL_REF)" location: "JS frame ::
/var/tmp/mozilla/dist/bin/components/nsXmlRpcClient.js :: anonymous ::
line 235" data:no]
************************************************************

JavaScript error:
line 0: uncaught exception: [Exception... "Could not convert
JavaScript argument (NULL value cannot be used for a C++ reference
type) arg 0 [nsISupports.QueryInterface]" nsresult: "0x8057000b
(NS_ERROR_XPC_BAD_CONVERT_JS_NULL_REF)" location: "JS frame ::
/var/tmp/mozilla/dist/bin/components/nsXmlRpcClient.js :: anonymous ::
line 235" data: no]


Anyone have a suggetion? it's an error on my setup on in mozilla?


thanks in advance

ciao, Alberto
Heikki Toivonen

2007-05-10, 6:38 pm

XML-RPC has bitrotted, someone would have to bring it up to date.

Alberto Berti wrote:

>
> Hi,
>
> I tried the xml-rpc.xul testfile on mozilla 0.9.1 loaded from a
> chrome:// url. When i press either the "Async" or the "Sync" button, the
> function breaks and mozilla dumps an exception on the console:
>
> Document chrome://test/content/xml-rpc.xul loaded successfully
> Call Async
> ************************************************************
> * Call to xpconnect wrapped JSObject produced this error: *
> [Exception... "Could not convert JavaScript argument (NULL value
> cannot be used for a C++ reference type) arg 0
> [nsISupports.QueryInterface]" nsresult: "0x8057000b
> (NS_ERROR_XPC_BAD_CONVERT_JS_NULL_REF)" location: "JS frame ::
> /var/tmp/mozilla/dist/bin/components/nsXmlRpcClient.js :: anonymous ::
> line 235" data:no]
> ************************************************************
>
> JavaScript error:
> line 0: uncaught exception: [Exception... "Could not convert
> JavaScript argument (NULL value cannot be used for a C++ reference
> type) arg 0 [nsISupports.QueryInterface]" nsresult: "0x8057000b
> (NS_ERROR_XPC_BAD_CONVERT_JS_NULL_REF)" location: "JS frame ::
> /var/tmp/mozilla/dist/bin/components/nsXmlRpcClient.js :: anonymous ::
> line 235" data: no]
>
>
> Anyone have a suggetion? it's an error on my setup on in mozilla?
>
>
> thanks in advance
>
> ciao, Alberto
>


Alberto Berti

2007-05-10, 6:38 pm

>>>>> "Heikki" == Heikki Toivonen <heikki@netscape.com> writes:

Heikki> XML-RPC has bitrotted, someone would have to bring it up
Heikki> to date.
Heikki> Alberto Berti wrote:

It can be upgraded to make use of the XMLHttpRequest() object....
Will Sargent

2007-05-10, 6:38 pm

Alberto Berti wrote:

>
> Hi,
>
> I tried the xml-rpc.xul testfile on mozilla 0.9.1 loaded from a
> chrome:// url. When i press either the "Async" or the "Sync" button, the
> function breaks and mozilla dumps an exception on the console:
>
> Document chrome://test/content/xml-rpc.xul loaded successfully
> Call Async
> ************************************************************
> * Call to xpconnect wrapped JSObject produced this error: *
> [Exception... "Could not convert JavaScript argument (NULL value
> cannot be used for a C++ reference type) arg 0
> [nsISupports.QueryInterface]" nsresult: "0x8057000b
> (NS_ERROR_XPC_BAD_CONVERT_JS_NULL_REF)" location: "JS frame ::
> /var/tmp/mozilla/dist/bin/components/nsXmlRpcClient.js :: anonymous ::
> line 235" data:no]


I'm trying to patch up the code. Anyone know what

var postStream = handler.NewPostDataStream(false, '\r\n' + request,
handler.ENCODE_NORMAL);

means? I had a look at nsIHttpProtocolHandler, and I'm not sure what
the replacement function is called.

The exception you're getting is because the interface was renamed from
nsIHTTPChannel to nsIHttpChannel. There are lots of other fun bugs
though...

Will.

Olivier Moises

2007-05-10, 6:38 pm

Hi,
The following example works fine with Mozilla 0.9.2 and Zope 2.4.0
I spent lot of time to try the xul example of XML-RPC with no success.
So I decide to test XMLHTTPRequest example
(mozilla\extensions\xmlextras\tests\post.html) with some modification.
I am a XUL/Mozilla newbie and so forgive me for the style.

The trouble is that I do not know how to run
mozilla\extensions\xmlextras\tests\syncpost.html ???


Olivier Moises


<html>
<body>
<h1>Posting test</h1>
<script>
const WSTRING_CONTRACTID = "@mozilla.org/supports-wstring;1";

// bypass file security default :

netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");

var p = new XMLHttpRequest();


function myfunc()
{
var str;
str = p.responseText;
alert(str);
document.write (str);
// alert(p.getAllResponseHeaders());
}

p.onload = myfunc;

p.open("POST", "http://localhost:8080");

var mystr =
Components.classes[WSTRING_CONTRACTID].createInstance(Components.interfaces.
nsISupportsWString);

mystr.data = "<?xml
version=\"1.0\"?><methodCall><methodName>testMethod</methodName>";
mystr.data = mystr.data + "<params>";
mystr.data = mystr.data + "<param><value><struct>";
mystr.data = mystr.data +
"<member><name>name</name><value>myName</value></member>";
mystr.data = mystr.data +
"<member><name>age</name><value><i4>42</i4></value></member>";
mystr.data = mystr.data + "</struct></value></param>";
mystr.data = mystr.data + "</params></methodCall>";
p.send(mystr);



</script>
</body>
</html>




Heikki Toivonen

2007-05-10, 6:38 pm

Olivier Moises wrote:

> So I decide to test XMLHTTPRequest example
> (mozilla\extensions\xmlextras\tests\post.html) with some modification.
> I am a XUL/Mozilla newbie and so forgive me for the style.
>
> The trouble is that I do not know how to run
> mozilla\extensions\xmlextras\tests\syncpost.html ???



I don't understand. If post.html works for you, syncpost.html should
work equally well. To test, you just open the file in your browser
(well, you need to have the echo.cgi script on some server you control
and change the URL in post and syncpost to point to it - which you must
have done since you say post was working).


--
Heikki Toivonen

Samuel Sieb

2007-05-10, 6:39 pm

I almost have this working, but I'm blocked by
http://bugzilla.mozilla.org/show_bug.cgi?id=100172

There were lots of changes in API that were not kept up with.

Alberto Berti wrote:

>
> Hi,
>
> I tried the xml-rpc.xul testfile on mozilla 0.9.1 loaded from a
> chrome:// url. When i press either the "Async" or the "Sync" button, the
> function breaks and mozilla dumps an exception on the console:
>



Sponsored Links


Copyright 2003 - 2009 forum4designers.com  Software forum  Computer Hardware reviews