[xpconnect wrapped (nsISupports, nsISOAPBlock, nsISOAPParameter)]
Here is the code that generated the response I received:
note: This code does not include my google key.
note: I am using Firefox 1.5.
function callGoogle() {
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
var key ="...";
var phrase = "helllo";
var p = new Array();
p[0] = new SOAPParameter(key,"key");
p[1] = new SOAPParameter(phrase, "phrase");
var soapCall = new SOAPCall();
soapCall.transportURI = "http://api.google.com/search/beta2";
soapCall.encode(0,"doSpellingSuggestion","urn:GoogleSearch",0,null,p.length,p);
var response = soapCall.invoke();
if(response.fault) {
alert("fault");
}
var rarray = response.getParameters(false,{});
var s = rarray[0];
document.write(s);
document.close();
}