On 27 juin 08, at 22:51, [email protected] wrote:
This does not work but gives me this error:
xmlrpclib.Fault: <Fault 0: 'Failed to invoke method addAttachment in class com.xpn.xwiki.xmlrpc.XWikiXmlRpcHandler: An XWiki id must be in the form Space.Page[?param=value¶m=value&...]'>
As I said, addAttachment is defined as (Integer, Attachment, Byte[]), but when passing in an integer it creates the above exception.
When using a String it bombs out with, no such message signature.
Hi In your previous message you wrote the following code: new_attachment = dict(id = '', pageId = '', title = '', fileName = 'filename', fileSize = '', contentType = 'content type', created = '', creator = '', url = '', comment = 'Some comment') #Make a attachment container I am not fluent in Python but here I understand that you are not setting the pageId. So basically you are not writing the equivalent of the snippet I posted earlier: you are leaving out the attachment.setPageId("Foo.Bar") method call (which is the one that sets the page to attach to). You should initialize your "attachment container" by specifying the pageId: new_attachment = dict(id = '', *pageId = 'Foo.Bar'*, title = '', fileName = 'filename', fileSize = '', contentType = 'content type', created = '', creator = '', url = '', comment = 'Some comment') #Make a attachment container That's the reason why IMHO your code raises the exception: pageId = '' and that's not in the form 'Space.Page[? param=value¶m=value&...]', as correctly reported by the exception. Try to correctly initialize the pageId in your dict and things should work fine. Let me know. -Fabio