Hi Joseph,<div><br></div><div>Right on, that&#39;s exactly what I needed to know.</div><div><br></div><div>I&#39;ve been using <a href="http://devzone.zend.com/article/1307">http://devzone.zend.com/article/1307</a> for the XML-RPC (lower level) API, and then building my own PHP library on top of that (with the Wordpress functions). I&#39;ll go and check out the IXR library to see if that helps.</div>
<div><br></div><div>All of the calls that I am making that pull data from Wordpress are working fine. It&#39;s just when trying to create data (wp.newComment, wp.newCategory, metaWeblog.newPost) they are all giving me similar data errors:</div>
<div><pre>Sorry, the new category failed.</pre><pre><pre>Invalid Data: Please go back and try again.</pre><pre><pre>Content, title, and excerpt are empty.</pre></pre></pre>I&#39;ve been debugging the thing to death and still can&#39;t get any closer. I have a feeling that it has something to do with how the struct datatypes are being encoded in the XML-RPC portion. Here is a sample of my code:</div>
<div><br></div><div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>$this-&gt;makeRequest(</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>&#39;wp.newComment&#39;,</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>array(</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>new xmlrpcval($blogId),</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>new xmlrpcval($this-&gt;username),</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span>new xmlrpcval($this-&gt;password),</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>new xmlrpcval($postId),</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>xmlrpc_encode(array(</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                        </span>&#39;comment_parent&#39;=&gt;intval(0),</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>&#39;content&#39;=&gt;strval($comment-&gt;content),</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                        </span>&#39;author&#39;=&gt;strval($comment-&gt;author),</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>&#39;author_url&#39;=&gt;strval($comment-&gt;author_url),</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                        </span>&#39;author_email&#39;=&gt;strval($comment-&gt;author_email)</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>)),</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>));</div>
<div><br></div><div>The structure containing the comment information ends up being encoded to this:</div><div><pre id="line1">&lt;<span class="start-tag">params</span>&gt;
&lt;<span class="start-tag">param</span>&gt;
 &lt;<span class="start-tag">value</span>&gt;
  &lt;<span class="start-tag">struct</span>&gt;
   &lt;<span class="start-tag">member</span>&gt;
    &lt;<span class="start-tag">name</span>&gt;comment_parent&lt;/<span class="end-tag">name</span>&gt;
    &lt;<span class="start-tag">value</span>&gt;
     &lt;<span class="start-tag">int</span>&gt;0&lt;/<span class="end-tag">int</span>&gt;
</pre><pre id="line10">    &lt;/<span class="end-tag">value</span>&gt;
   &lt;/<span class="end-tag">member</span>&gt;
   &lt;<span class="start-tag">member</span>&gt;
    &lt;<span class="start-tag">name</span>&gt;content&lt;/<span class="end-tag">name</span>&gt;
    &lt;<span class="start-tag">value</span>&gt;
     &lt;<span class="start-tag">string</span>&gt;comment&lt;/<span class="end-tag">string</span>&gt;
    &lt;/<span class="end-tag">value</span>&gt;
   &lt;/<span class="end-tag">member</span>&gt;
</pre><pre id="line18">   &lt;<span class="start-tag">member</span>&gt;
    &lt;<span class="start-tag">name</span>&gt;author&lt;/<span class="end-tag">name</span>&gt;
    &lt;<span class="start-tag">value</span>&gt;
     &lt;<span class="start-tag">string</span>&gt;Tim&lt;/<span class="end-tag">string</span>&gt;
    &lt;/<span class="end-tag">value</span>&gt;
   &lt;/<span class="end-tag">member</span>&gt;
   &lt;<span class="start-tag">member</span>&gt;
    &lt;<span class="start-tag">name</span>&gt;author_url&lt;/<span class="end-tag">name</span>&gt;
</pre><pre id="line26">    &lt;<span class="start-tag">value</span>&gt;
     &lt;<span class="start-tag">string</span>&gt;<a href="http://www.golen.net/blog">http://www.golen.net/blog</a>&lt;/<span class="end-tag">string</span>&gt;
    &lt;/<span class="end-tag">value</span>&gt;
   &lt;/<span class="end-tag">member</span>&gt;
   &lt;<span class="start-tag">member</span>&gt;
    &lt;<span class="start-tag">name</span>&gt;author_email&lt;/<span class="end-tag">name</span>&gt;
    &lt;<span class="start-tag">value</span>&gt;
     &lt;<span class="start-tag">string</span>&gt;<a href="mailto:tim@golen.net">tim@golen.net</a>&lt;/<span class="end-tag">string</span>&gt;
</pre><pre id="line34">    &lt;/<span class="end-tag">value</span>&gt;
   &lt;/<span class="end-tag">member</span>&gt;
  &lt;/<span class="end-tag">struct</span>&gt;
 &lt;/<span class="end-tag">value</span>&gt;
&lt;/<span class="end-tag">param</span>&gt;
&lt;/<span class="end-tag">params</span>&gt;
</pre></div><div><br></div><div>And all that is encoded the way they discuss it at <a href="http://devzone.zend.com/article/1307">http://devzone.zend.com/article/1307</a>. I&#39;ll take a look at the IXR library and see if that does any better of a job. I appreciate all of your help and suggestions with this! Once I get the PHP library built, I think it would be an invaluable resource to post on the Wordpress site somewhere.</div>
<div><br></div><div>Tim </div><div><br></div><div class="gmail_quote">On Tue, Jun 15, 2010 at 12:37 PM, Joseph Scott <span dir="ltr">&lt;<a href="mailto:joseph@josephscott.org">joseph@josephscott.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">There are 2 different &quot;levels&quot; of libraries for the the WP XML-RPC<br>
APIs.  First, lower level XML-RPC only APIs.  These take care of all<br>
the XML-RPC work, but don&#39;t know anything about the specific methods<br>
that WordPress provides.  For that layer I recommend the PHP IXR<br>
library, which is what WordPress uses.<br>
<br>
The next level up are libraries both take care of the XML-RPC details<br>
and know about the various methods that WP exposes.  I&#39;ve seen some<br>
Perl libraries that fit into this category, but I haven&#39;t seen much in<br>
the of PHP ones.<br>
<div><div></div><div class="h5"><br>
On Tue, Jun 15, 2010 at 11:51 AM, Tim Golen &lt;<a href="mailto:tim@golen.net">tim@golen.net</a>&gt; wrote:<br>
&gt; Is there already an existing PHP library for the Wordpress API? I&#39;m still<br>
&gt; running into problems and don&#39;t need to reinvent the wheel if it&#39;s already<br>
&gt; been done. The MetaWeblog API mentions a PHP library, but it comes up with a<br>
&gt; 404 error, and the MetaWeblog site hasn&#39;t been updated since 2003.<br>
&gt; Errors like &quot;Invalid Data: Please go back and try again.&quot; when trying to do<br>
&gt; something rather simple like create a comment can get really frustrating.<br>
<br>
<br>
<br>
</div></div><font color="#888888">--<br>
Joseph Scott<br>
<a href="mailto:joseph@josephscott.org">joseph@josephscott.org</a><br>
<a href="http://josephscott.org/" target="_blank">http://josephscott.org/</a><br>
</font><div><div></div><div class="h5">_______________________________________________<br>
wp-xmlrpc mailing list<br>
<a href="mailto:wp-xmlrpc@lists.automattic.com">wp-xmlrpc@lists.automattic.com</a><br>
<a href="http://lists.automattic.com/mailman/listinfo/wp-xmlrpc" target="_blank">http://lists.automattic.com/mailman/listinfo/wp-xmlrpc</a><br>
</div></div></blockquote></div><br></div>