[Zope] How do I form an XML-RPC query to a remote server?

Tony McDonald tony.mcdonald@ncl.ac.uk
Fri, 17 Nov 2000 16:44:01 +0000


On 16/11/00 7:10 am, "Edward Muller" <edwardam@home.com> wrote:

> On Wed, 15 Nov 2000, Tony McDonald wrote:
> 
>> Hi all,
>> I'm experimenting with collating data from a remote database that uses
>> XML-RPC.
>> 
>> I can send it messages like;
>>>>> import xmlrpclib
>>>>> medweb = xmlrpclib.Server("http://bogus.server.com")
>>>>> medweb.getImages('scar')
> 
> That looks right...
> 

Yup, that bit works! :)

>> '<?xml version="1.0" encoding="ISO-8859-1"
>> ?>\015\012\011<data>\015\012\011\011<title>Medwebb Images</title> \0
>> 
>> (lots of stuff snipped)
>> 
> 
> That doesn't ... I don't think they have a well formed XML-RPC document, so
> xmlrpclib can't parse it...

I think that is ok XML. The \015\012 are just LF-CRs and are ignored.

> 
>> But I just can't figure out how to send the XML version of the same query,
>> ie
> 
> xmlrpclib handles the marshaling/un-marshaling to xml/from python for you...

Absolutely, and it works fine when I do it from a Python prompt.

> 
>> <?XML VERSION="1.0"?>
>> <methodCall>
>>     <methodName>getimages</methodName>
>>     <params>
>>         <param>
>>             <value><string>scar</string></value>
>>             </param>
>>         </params>
>>     </methodCall>
>> 
>> to the server.
>> 

I'm really just trying to get a Zope equivalent of the Userland 'debugger'
at <http://frontier.userland.com/stories/storyReader$1077> as I think these
queries may get more complex.

> 
> xmlrpc lib is already constructing this...or it should be,,,
> 
>> I've got a nasty feeling that when I get told how to do this, I'm going to
>> slap my forehead bloody hard....
> 
> See above :-)
> 

I'll take Michels advice and wear a helmet to work! :)
Cheers,
Tone.
------
Dr Tony McDonald,  Assistant Director, FMCC, http://www.fmcc.org.uk/
The Medical School, Newcastle University Tel: +44 191 222 5116
A Zope list for UK HE/FE  http://www.fmcc.org.uk/mailman/listinfo/zope