[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:35:23 +0000


On 15/11/00 5:58 pm, "Michel Pelletier" <michel@digicool.com> wrote:

> 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')
>> '<?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)
>> 
>> But I just can't figure out how to send the XML version of the same query,
>> ie
>> <?XML VERSION="1.0"?>
>> <methodCall>
>>     <methodName>getimages</methodName>
>>     <params>
>>         <param>
>>             <value><string>scar</string></value>
>>             </param>
>>         </params>
>>     </methodCall>
>> 
>> to the server.
> 
> How does it fail?  Did you set the right content type (text/xml I
> think?)?
> 
Thanks for the reply Michel,
Yes the content type is text/xml, but I guess I'm doing something else
wrong.

> Why do you want to send a hand built query to the server?  That's what
> xmlrpclib is for.

Oh definitely, but I'm trying to do it this way as I think the queries may
get more complex...


> 
> -Michel
> 
>> I've got a nasty feeling that when I get told how to do this, I'm going to
>> slap my forehead bloody hard....
> 
> Do what I do, where a helmet to work.
> 

I like that! :)
------
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