diff --git a/extensions/webservices/proxy/tests/iitest.html b/extensions/webservices/proxy/tests/iitest.html index 9bc81c4d841..7194e5c5eff 100644 --- a/extensions/webservices/proxy/tests/iitest.html +++ b/extensions/webservices/proxy/tests/iitest.html @@ -2,10 +2,7 @@ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); -const factoryClass = Components.classes["@mozilla.org/xmlextras/proxy/webserviceproxyfactory;1"]; -const factoryID = Components.interfaces.nsIWebServiceProxyFactory; - -var factory = factoryClass.getService(factoryID); +var factory = new WebServiceProxyFactory(); const IDL_GENERATOR = new Components.Constructor("@mozilla.org/interfaceinfotoidl;1", @@ -21,6 +18,8 @@ const IInfoNamed = new Components.Constructor("@mozilla.org/scriptableInterfaceI var listener = { onLoad : function(proxy) { + var name; + var ask = window.ask; //alert("happy"); return; netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); @@ -34,37 +33,48 @@ var listener = { // writing to our document whacks the preexisting stuff... document.write("
"); - document.write(gen.generateIDL(proxy.primaryIID, true, true)); - var list = gen.getReferencedInterfaceNames(proxy.primaryIID, {}); + document.write("\n#include \"nsISupports.h\"\n\n"); - for(var i = 0; i < list.length; i++) { - var iface = new IInfoNamedCtor(list[i]); - if(iface.name == primaryIface.name) + document.write("// forward declarations...\n"); + for(var name in proxy.interfaces) { + if(name == "nsISupports") + continue; + document.write("interface "+name+";\n"); + } + + document.write("\n"); + + for(var name in proxy.interfaces) { + var id = proxy.interfaces[name]; + + if(0 == id.name.indexOf("nsI")) continue; - document.write("\n//-------------------------------------\n"); + document.write("//-------------------------------------"); - document.write(gen.generateIDL(iface.interfaceID, false, false)); + document.write(gen.generateIDL(Components.ID(id.number), false, false)); } - + document.write(""); document.close(); }, onError : function(e) { // alert("sad"); return; netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); - + // writing to our document whacks the preexisting stuff... - document.write(e); + document.write("
"); + document.write("error: "+e); document.close(); } }; - //const ISPRIMEURL = "http://green.nscp.aoltw.net/vidur/wsdl/statistics.wsdl"; const ISPRIMEURL = "http://bugsfree.nscp.aoltw.net/pub/statistics.wsdl"; +//const ISPRIMEURL = "http://bugsfree.nscp.aoltw.net/pub/statistics2.wsdl"; //const ISPRIMEURL = "http://213.23.125.181:8080/statistics.wsdl"; + const ISPRIMEPORT = "SpheonJSAOPStatisticsPort"; factory.createProxyAsync(ISPRIMEURL, ISPRIMEPORT, "foo", true, listener); diff --git a/extensions/xmlextras/proxy/src/tests/iitest.html b/extensions/xmlextras/proxy/src/tests/iitest.html index 9bc81c4d841..7194e5c5eff 100644 --- a/extensions/xmlextras/proxy/src/tests/iitest.html +++ b/extensions/xmlextras/proxy/src/tests/iitest.html @@ -2,10 +2,7 @@ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); -const factoryClass = Components.classes["@mozilla.org/xmlextras/proxy/webserviceproxyfactory;1"]; -const factoryID = Components.interfaces.nsIWebServiceProxyFactory; - -var factory = factoryClass.getService(factoryID); +var factory = new WebServiceProxyFactory(); const IDL_GENERATOR = new Components.Constructor("@mozilla.org/interfaceinfotoidl;1", @@ -21,6 +18,8 @@ const IInfoNamed = new Components.Constructor("@mozilla.org/scriptableInterfaceI var listener = { onLoad : function(proxy) { + var name; + var ask = window.ask; //alert("happy"); return; netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); @@ -34,37 +33,48 @@ var listener = { // writing to our document whacks the preexisting stuff... document.write(""); - document.write(gen.generateIDL(proxy.primaryIID, true, true)); - var list = gen.getReferencedInterfaceNames(proxy.primaryIID, {}); + document.write("\n#include \"nsISupports.h\"\n\n"); - for(var i = 0; i < list.length; i++) { - var iface = new IInfoNamedCtor(list[i]); - if(iface.name == primaryIface.name) + document.write("// forward declarations...\n"); + for(var name in proxy.interfaces) { + if(name == "nsISupports") + continue; + document.write("interface "+name+";\n"); + } + + document.write("\n"); + + for(var name in proxy.interfaces) { + var id = proxy.interfaces[name]; + + if(0 == id.name.indexOf("nsI")) continue; - document.write("\n//-------------------------------------\n"); + document.write("//-------------------------------------"); - document.write(gen.generateIDL(iface.interfaceID, false, false)); + document.write(gen.generateIDL(Components.ID(id.number), false, false)); } - + document.write(""); document.close(); }, onError : function(e) { // alert("sad"); return; netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); - + // writing to our document whacks the preexisting stuff... - document.write(e); + document.write(""); + document.write("error: "+e); document.close(); } }; - //const ISPRIMEURL = "http://green.nscp.aoltw.net/vidur/wsdl/statistics.wsdl"; const ISPRIMEURL = "http://bugsfree.nscp.aoltw.net/pub/statistics.wsdl"; +//const ISPRIMEURL = "http://bugsfree.nscp.aoltw.net/pub/statistics2.wsdl"; //const ISPRIMEURL = "http://213.23.125.181:8080/statistics.wsdl"; + const ISPRIMEPORT = "SpheonJSAOPStatisticsPort"; factory.createProxyAsync(ISPRIMEURL, ISPRIMEPORT, "foo", true, listener);