Note that there are some explanatory texts on larger screens.

plurals
  1. POThe "membername" member is not of type base64 error from xml-rpc service call
    primarykey
    data
    text
    <p>I'm using Charles Cook's xml-rpc.net in an attempt to make an xml-rpc service call.</p> <p>The request needs to be sent in this format:</p> <pre><code>&lt;?xml version="1.0" encoding="iso-8859-1"?&gt; &lt;methodCall&gt; &lt;methodName&gt;leads&lt;/methodName&gt; &lt;params&gt; &lt;param&gt; &lt;value&gt; &lt;struct&gt; &lt;member&gt; &lt;name&gt;key&lt;/name&gt; &lt;value&gt; &lt;string&gt;XXXXXXXXXXX&lt;/string&gt; &lt;/value&gt; &lt;/member&gt; &lt;member&gt; &lt;name&gt;leads&lt;/name&gt; &lt;value&gt; &lt;base64&gt;PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPGxlYWRzPgogICA8bGVhZD4K ICAgICAgPGlkPjM5OTk3PC9pZD4KICAgICAgPEZpcnN0TmFtZT5Cb2IgSmltPC9GaXJzdE5hbWU+ CiAgICAgIDxMYXN0TmFtZT5TbWl0aDwvTGFzdE5hbWU+CiAgICAgIDxBZGRyZXNzPjEyMzQgV2Vz : : ICAgICA8UmVjZWl2ZUFkZGxJbmZvPlllczwvUmVjZWl2ZUFkZGxJbmZvPgogICAgICA8bG9wX3dj X3N0YXR1cz5ObzwvbG9wX3djX3N0YXR1cz4KICAgPC9sZWFkPgo8L2xlYWRzPg== &lt;/base64&gt; &lt;/value&gt; &lt;/member&gt; &lt;/struct&gt; &lt;/value&gt; &lt;/param&gt; &lt;/params&gt; &lt;/methodCall&gt; </code></pre> <p>Where member name contains multiple tags in this format:</p> <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;leads xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.siteName.com/Leads" xsi:schemaLocation="http://www.siteName.com/Leads Leads.xsd" version="1.0"&gt; &lt;lead&gt; &lt;id&gt;39997&lt;/id&gt; &lt;first_name&gt;Jim&lt;/first_name&gt; &lt;last_name&gt;Smith&lt;/last_name&gt; &lt;address&gt;1234 West 5th Street&lt;/address&gt; &lt;address2/&gt; &lt;city&gt;Beverly Hills&lt;/city&gt; &lt;state_or_province&gt;CA&lt;/state_or_province&gt; &lt;country&gt;USA&lt;/country&gt; &lt;postal_code&gt;90210&lt;/postal_code&gt; &lt;best_number&gt;555-121-3322&lt;/best_number&gt; &lt;best_number_ext/&gt; &lt;alt_number/&gt; &lt;alt_number_ext/&gt; &lt;time_zone&gt;Pacific&lt;/time_zone&gt; &lt;best_time&gt;mid day&lt;/best_time&gt; &lt;request_uri&gt;http://siteName.com/contact/ ?source=VendorName&amp;amp;leadid=VendorId&amp;amp;ad=SomeAd&lt;/request_uri&gt; &lt;handoff_id&gt;X-vendorid&lt;/handoff_id&gt; &lt;/lead&gt; &lt;lead&gt; &lt;id&gt;39987&lt;/id&gt; &lt;first_name&gt;George&lt;/first_name&gt; : : &lt;lop_wc_status&gt;No&lt;/lop_wc_status&gt; &lt;request_uri&gt;http://siteName.com/contact/ ?source=VendorName&amp;amp;leadid=VendorId&amp;amp;ad=SomeAd&lt;/request_uri&gt; &lt;/lead&gt; &lt;/leads&gt; </code></pre> <p>The documentation on the webservice method calls for one parameter that contains two values (array of values) - key and leads. The xml document containing the leads data must be packaged as a binary object. This value must be named leads and must be of type base64.</p> <p>Here's what I got so far that is failing:</p> <p>My struct containing the leads info-</p> <pre><code> [Serializable] public struct myLeads { public string id; public string first_name; public string last_name; } </code></pre> <p>The interface</p> <pre><code> public interface ILead { [CookComputing.XmlRpc.XmlRpcMethod("leads", StructParams = true)] string NewLead(string key, myLeads leads); } </code></pre> <p>Finally, I initialize the struct values and call the method:</p> <pre><code> myLeads newLead = default(newLeads); Guid guid = System.Guid.NewGuid(); newLead.id = guid.ToString(); newLead.first_name = "Test"; newLead.last_name = "LastNameTest"; newLead.address = "111 Test St"; var leadPost = (ILead)XmlRpcProxyGen.Create(typeof(ILead)); var clientProtocol = (XmlRpcClientProtocol)leadPost; clientProtocol.Url = "https://dashboard.sitename.com/webservices/rpc/xmlrpc"; try { result = leadPost.NewLead("XXXKeyXXX", newLead); Label1.Text = result; } catch (Exception ex) { throw ex; } </code></pre> <p>My code throws the error in the try block: The leads member is not of type base64! How do I set this up properly?</p> <p>Thanks in advance!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload