<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class="">Hi There,<br class=""><br class="">TL;DR I can’t get NWC-RPC to encode .NET object such as OpenMetaverse’s UUID or System.Net.IEndpoint - anyone know how to do this?<div class=""><br class="">I am trying to get the NWC-RPC .NET module to communicate with my money server. The money server registers XML RPC calls with the grid like this:<br class=""><br class=""><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class="">m_httpServer.AddXmlRPCHandler("CancelTransfer", handleCancelTransfer)</blockquote><br class="">The handleCanceTransfer’s signature looks like this:<br class=""><br class=""> public XmlRpcResponse handleCancelTransfer(XmlRpcRequest request, IPEndPoint remoteClient)<br class=""><br class="">My code looks like this (and it’s a copy/paste with a few tweaks from here):<br class=""><br class=""><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class="">using System;<br class="">using System.Collections;<br class="">using System.Collections.Generic;<br class="">using System.Net;<br class="">using Nwc.XmlRpc;<br class="">using OpenMetaverse;<br class="">namespace Call_With_NWC<br class="">{<br class=""> class MainClass<br class=""> {<br class=""> public static void Main(string[] args)<br class=""> {<br class=""> System.Net.ServicePointManager.CertificatePolicy = new ITrustAllCertificates();<br class=""> Hashtable ht = new Hashtable();<br class=""> ht["remoteClient"] = new IPEndPoint(IPAddress.Parse("192.168.0.1"), 80);<br class=""> ht["secureCode"] = "code";<br class=""> ht["transactionID"] = UUID.Random(); // UUID Line<br class=""> Console.WriteLine("New GUID: " + ht["transactionID"]);<br class=""> List<Hashtable> parameters = new List<Hashtable> { ht };<br class=""> XmlRpcRequest request = new XmlRpcRequest("CancelTransaction", parameters);<br class=""> Hashtable response;<br class=""> try {<br class="">// response = (Hashtable)request.Invoke("https://192.168.0.164:8008");<br class=""> response = (Hashtable)request.Invoke("http://192.168.0.1:9000");<br class=""> Console.WriteLine("It seems to have worked...");<br class=""> foreach (var key in response.Keys)<br class=""> {<br class=""> Console.WriteLine("Key: " + key + " => " + response[key]);<br class=""> }<br class=""> } catch (Exception ex) {<br class=""> Console.WriteLine("Got an exception:\n" + ex.ToString());<br class=""> }<br class=""> }<br class=""> }<br class="">}</blockquote><br class="">The money server consistently complains that the secureCode and UUID are empty - when in fact…they are…because I wrote up a little “Dump the request†server and get:<br class=""><br class="">Message of length 348 was defined but not a blessed scalar.<br class=""><?xml version="1.0" encoding="utf-8"?><br class=""><methodCall><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><methodName><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>CancelTransaction<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span></methodName><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><params><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><param><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><value><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><struct><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><member><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><name><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>transactionID<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span></name><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><value/><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span></member><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><member><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><name><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>remoteClient<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span></name><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><value/><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span></member><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><member><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><name><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>secureCode<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span></name><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><value><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><string><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>code<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span></string><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span></value><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span></member><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span></struct><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span></value><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span></param><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span></params><br class=""></methodCall><div class=""><br class=""></div><div class="">In fact, the NWC-XML-RPC is behaving as though it doesn’t know how to encode anything but plain strings. The transactionID should be the type OpenMetavers.UUID (which seems to be a wrapper around GUUID) and remoteClient should be an IEndPoint from <a href="http://System.Net" class="">System.Net</a>.</div><div class=""><br class=""></div><div class="">Obviously I’m missing something but I’m not sure what.</div><div class=""><br class=""></div><div class="">How does one encode OpenMetaverse and other .NET objects so that the XML-RPC client on the other end is able to decode them?</div><div class=""><br class=""></div><div class="">DSL</div></div></body></html>