<div class="gmail_quote">On Mon, Mar 7, 2011 at 6:40 PM, <span dir="ltr"><<a href="mailto:jeff@ayendesigns.com">jeff@ayendesigns.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div bgcolor="#ffffff" text="#000000">
<p style="margin-bottom:0cm;margin-top:0pt">Victor, two
questions regarding this (for now). Where does another server
sending the request get a session id to send? </p></div></blockquote><div><br></div><div>Second line:</div><div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">$anon_session = xmlrpc($server, 'system.connect');</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><br></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">This is then reused in the login request:</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><br></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><meta http-equiv="content-type" content="text/html; charset=utf-8">$authenticated_session = xmlrpc($server, 'user.login', $anon_session['sessid'], $user, $password);</span></div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div bgcolor="#ffffff" text="#000000"><p style="margin-bottom:0cm;margin-top:0pt">And in this example,
and really every one I've seen, a standard method is being used
(node.get in this one), but I'm wondering if part of the issue is
that I'm defining a method in my module as opposed to using one
packaged with the services module.</p></div></blockquote><div><br></div><div>That's fine. I did the same thing recently, for example uploading performance times to a performance content type. I copied the closest existing service module into my own module and edited it. That way, I had my own custom service written as part of services.</div>
<div><br></div><div>For a bare-bones xmlprc example using Drupal functions without the services module, check out my 2007 article leveraging hook_xmlrpc:</div><div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><a href="http://awebfactory.com.ar/node/234">http://awebfactory.com.ar/node/234</a> </div>
<div><br></div><div>This gets it done.</div><div><br></div><div>Either way, your own code can implement the logic you describe.</div><div><br></div><div>Victor</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div bgcolor="#ffffff" text="#000000"><p style="margin-bottom:0cm;margin-top:0pt"> In my case, I'm receiving data,
and if its id matches a cck value in a content type I take the
data and update a field in the node with it, if not, I put the
data into a holding queue until there -is- a node with the id
being matched by the cck field.</p><div><div></div><div class="h5"><br>
<br>
On 03/07/2011 04:14 PM, Victor Kane wrote:<br>
</div></div><p></p><div><div></div><div class="h5">
<blockquote type="cite">Maybe this will help. I recently launched
<a href="http://projectflowandtracker.com/" target="_blank">http://projectflowandtracker.com/</a> (on
Pantheon, yay!) in alpha (beta will come with jquery enhanced
usability improvements) and was working on an everything in code
basis; so... I had to import from the legacy site all the
projects, user stories, etc. for the 150-200 folks who had been
using the previous version.
<div>
<br>
</div>
<div>I opted to use services on the legacy site, and did not use
the authentication key, but opted for user login instead,
bringing the stuff over to the new site using the Drupal API <a href="http://api.drupal.org/api/drupal/includes--common.inc/function/xmlrpc/6" target="_blank">http://api.drupal.org/api/drupal/includes--common.inc/function/xmlrpc/6</a> which
does not need to be downloaded or required.</div>
<div><br>
</div>
<div>
<div>/*</div>
<div> * client code for use with Services 6.x-2.4</div>
<div> * with following modules enabled on server, and
following server config:</div>
<div> * Key Authentication, XMLRPC Server, Node Service,
System Service, User Service, Views Service</div>
<div> * with no special permissions for anonymous on server</div>
<div> * Key Authentication is chosen at Site building >
Services > Settings</div>
<div> * but Use ssid selected, Use keys de-selected</div>
<div> */</div>
</div>
<div><br>
</div>
<div>
<div>$server = '<a href="http://legacy.projectflowandtracker.com/services/xmlrpc" target="_blank">http://legacy.projectflowandtracker.com/services/xmlrpc</a>';</div>
<div><br>
</div>
<div>$anon_session = xmlrpc($server, 'system.connect');</div>
<div><br>
</div>
<div>// login as...</div>
<div>// Use anon session id to login with authentication</div>
<div>$user = 'the_user';</div>
<div>$password = 'the_password';</div>
<div>$authenticated_session = xmlrpc($server, 'user.login',
$anon_session['sessid'], $user, $password);</div>
<div> if (xmlrpc_error()) {</div>
<div> $error_num = xmlrpc_errno();</div>
<div> $error = xmlrpc_error();</div>
<div> print_r ($error);</div>
<div> }</div>
<div><br>
</div>
<div>/*********** code just to bring a single node
****************/</div>
<div>$xmlrpc_result = xmlrpc($server, 'node.get',
$authenticated_session['sessid'], 2);</div>
<div> if (xmlrpc_error()) {</div>
<div> $error_num = xmlrpc_errno();</div>
<div> $error = xmlrpc_error();</div>
<div> print_r ($error);</div>
<div> }</div>
<div>print '<pre>' . print_r($xmlrpc_result, TRUE) .
'</pre>';</div>
<div><br>
</div>
</div>
<div>This worked for me.</div>
<div><br>
</div>
<div>Victor Kane</div>
<div><a href="http://awebfactory.com.ar" target="_blank">http://awebfactory.com.ar</a></div>
<div><a href="http://projectflowandtracker.com" target="_blank">http://projectflowandtracker.com</a></div>
</blockquote>
</div></div></div>
</blockquote></div><br>