<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div>The error given by the Money Server is:<div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 14px; font-family: Menlo; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);" class="">Money # 04:57:46 - [MONEY RPC]: handleCancelTransfer: Exception occurred when transaction 94786877-9ed6-4d36-98d7-9a88f7b52acf: System.NullReferenceException: Object reference not set to an instance of an object</div><div style="margin: 0px; font-size: 14px; font-family: Menlo; color: rgb(41, 249, 20); background-color: rgb(0, 0, 0);" class="">  at OpenSim.Grid.MoneyServer.MoneyXmlRpcModule.handleCancelTransfer (Nwc.XmlRpc.XmlRpcRequest request, System.Net.IPEndPoint remoteClient) [0x00000] in <filename unknown>:0</div></div><div class=""><br class=""></div><div class="">This is because it’s attempting to dereference a string (if I do UUID.Random().ToString()) or an empty value.</div><div class=""><br class=""></div><div class="">DSL</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 29 Nov 2014, at 9:30 am, David Lloyd <<a href="mailto:lloy0076@adam.com.au" class="">lloy0076@adam.com.au</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div 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 <a href="http://System.Net" class="">System.Net</a>;<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("<a href="https://192.168.0.164:8008" class="">https://192.168.0.164:8008</a>");<br class="">                response = (Hashtable)request.Invoke("<a href="http://192.168.0.1:9000" class="">http://192.168.0.1:9000</a>");<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 style="white-space:pre" class="Apple-tab-span">       </span><methodName><br class=""><span style="white-space:pre" class="Apple-tab-span">             </span>CancelTransaction<br class=""><span style="white-space:pre" class="Apple-tab-span">      </span></methodName><br class=""><span style="white-space:pre" class="Apple-tab-span">    </span><params><br class=""><span style="white-space:pre" class="Apple-tab-span">         </span><param><br class=""><span style="white-space:pre" class="Apple-tab-span">                  </span><value><br class=""><span style="white-space:pre" class="Apple-tab-span">                          </span><struct><br class=""><span style="white-space:pre" class="Apple-tab-span">                                 </span><member><br class=""><span style="white-space:pre" class="Apple-tab-span">                                         </span><name><br class=""><span style="white-space:pre" class="Apple-tab-span">                                                   </span>transactionID<br class=""><span style="white-space:pre" class="Apple-tab-span">                                          </span></name><br class=""><span style="white-space:pre" class="Apple-tab-span">                                          </span><value/><br class=""><span style="white-space:pre" class="Apple-tab-span">                                 </span></member><br class=""><span style="white-space:pre" class="Apple-tab-span">                                        </span><member><br class=""><span style="white-space:pre" class="Apple-tab-span">                                         </span><name><br class=""><span style="white-space:pre" class="Apple-tab-span">                                                   </span>remoteClient<br class=""><span style="white-space:pre" class="Apple-tab-span">                                           </span></name><br class=""><span style="white-space:pre" class="Apple-tab-span">                                          </span><value/><br class=""><span style="white-space:pre" class="Apple-tab-span">                                 </span></member><br class=""><span style="white-space:pre" class="Apple-tab-span">                                        </span><member><br class=""><span style="white-space:pre" class="Apple-tab-span">                                         </span><name><br class=""><span style="white-space:pre" class="Apple-tab-span">                                                   </span>secureCode<br class=""><span style="white-space:pre" class="Apple-tab-span">                                             </span></name><br class=""><span style="white-space:pre" class="Apple-tab-span">                                          </span><value><br class=""><span style="white-space:pre" class="Apple-tab-span">                                                  </span><string><br class=""><span style="white-space:pre" class="Apple-tab-span">                                                         </span>code<br class=""><span style="white-space:pre" class="Apple-tab-span">                                                   </span></string><br class=""><span style="white-space:pre" class="Apple-tab-span">                                                </span></value><br class=""><span style="white-space:pre" class="Apple-tab-span">                                 </span></member><br class=""><span style="white-space:pre" class="Apple-tab-span">                                </span></struct><br class=""><span style="white-space:pre" class="Apple-tab-span">                        </span></value><br class=""><span style="white-space:pre" class="Apple-tab-span">         </span></param><br class=""><span style="white-space:pre" class="Apple-tab-span"> </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></div>_______________________________________________<br class="">Opensim-users mailing list<br class=""><a href="mailto:Opensim-users@opensimulator.org" class="">Opensim-users@opensimulator.org</a><br class="">http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-users<br class=""></div></blockquote></div><br class=""></div></body></html>