Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

While googling, I found this discussion of the XML RPC Plugin for Trac. I'm not sure how/whether this plugin is the one you use, but it lists the following Python code as sample code:

import xmlrpclib server = xmlrpclib.ServerProxy("http://athomas:password@localhost:8080 +/trunk/login/xmlrpc") server.wiki.putAttachment('WikiStart/t.py', xmlrpclib.Binary(open('t.p +y').read()))

So, likely, you can use that Python code to get a sample of what you have to send using XML::RPC. It seems to send a different number of paramters than your scample does, though, so maybe it's the wrong end in the tree.

From my cursory look at XML::RPC, your approach of simply sending the base64-encoded data should be OK, but maybe you need to replace it by:

my $result = $xmlrpc->call('ticket.putAttachment', 2, 'Filename', 'Some Description', sub { +{base64 => encode_base64('data, data + - it is always the data')} }, );

... which is what the "Custom Types" section at the end of the documentation suggests.


In reply to Re: Accessing Trac via XML::RPC by Corion
in thread Accessing Trac via XML::RPC by PetaMem

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-19 19:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found