roller-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pieter Steyn" <pieter...@gmail.com>
Subject XMLRPC Problem
Date Fri, 01 Feb 2008 07:48:36 GMT
Hi guys,

Could anyone please tell me what I'm doing wrong?

I'm trying to upload an image through xmlrpc via a ruby script (have
tried perl aswel with same results)

Code:

#Ruby code

require 'xmlrpc/client'

server = XMLRPC::Client.new(hostname, /roller/roller-services/xmlrpc, 8080)

stuct = {}

struct["name"] = "newpicture.jpg"
struct["type"] = "image/jpeg"
struct["bits"] = Base64.b64encode(File.read("newpicture.jpg"))

server.call('metaWeblog.newMediaObject', 'blogid', 'username',
'password', struct)

ERROR:

XMLRPC::FaultException: XMLRPC::FaultException

Failed to invoke method newMediaObject in class
org.apache.roller.weblogger.webservices.xmlrpc.MetaWeblogAPIHandler:
java.lang.String cannot be cast to [B


#end code

Any ideas?

Thanks,
Pieter Steyn

Mime
View raw message