after having limitted success with examples on the web, i have a script that works (note: i have installed it as a chrome package in firefox 1.0 pr). however, when i change the host to 'localhost' i keep getting problems with premature stream closing. i have seen other people complain of the same thing.

any ideas?
mike g

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window title="XML-RPC Introspection"
    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";>

    <!-- NOTE: CVS version 1.1 of this file has useful examples! -->
<script>
<![CDATA[
/**
 * Sends a message/request to an xml-rpc server.
 */
var xmlRpcClient = Components.classes['@mozilla.org/xml-rpc/client;1']
  .createInstance(Components.interfaces.nsIXmlRpcClient);

/**
 * String argument to xml-rpc call.
 */
 var argValue = xmlRpcClient.createType(xmlRpcClient.STRING,{});
   argValue.data = "system.listMethods";

/**
 * Handles a response from xml-rpc server: an implementation of the
 * nsIXmlRpcClientListener interface.
 */
var xmlRpcClientListener = {
  onResult: function(client, methodList, result) {
    alert("Result: " + result.QueryInterface(Components
      .interfaces.nsISupportsCString));
  },

  onFault: function (client, ctxt, fault) {
    alert('XML-RPC Fault: ' + fault);
  },

  onError: function (client, ctxt, status, errorMsg) {
    alert('Error: ' + errorMsg);
  }
};

/**
 * Indicate which xml-rpc server to send a request.
 */
xmlRpcClient.init("http://xmlrpc.usefulinc.com:80/demo/server.php";);

/**
* Make the call to the server.
*/
xmlRpcClient
.asyncCall(xmlRpcClientListener, null, "system.methodHelp", [argValue], 1);
]]>
</script>
</window>
_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to