xmlrpc question

Discussion in 'Ruby' started by Joe Van Dyk, Aug 17, 2005.

  1. Joe Van Dyk

    Joe Van Dyk Guest

    Hi,

    Using ruby's xmlrpc, how can I view the XML that's being generated by
    XMLRPC::Client.call and the XML that's being returned from XMLRPC
    server?

    Thanks,
    Joe
     
    Joe Van Dyk, Aug 17, 2005
    #1
    1. Advertising

  2. Joe Van Dyk

    Joe Van Dyk Guest

    Aha, XMLRPC::Marshal.dump_response does the trick...

    Now I'm looking for a way to nicely display XML (with linebreaks and whatno=
    t)

    On 8/16/05, Joe Van Dyk <> wrote:
    > Hi,
    >=20
    > Using ruby's xmlrpc, how can I view the XML that's being generated by
    > XMLRPC::Client.call and the XML that's being returned from XMLRPC
    > server?
    >=20
    > Thanks,
    > Joe
    >=20
    >
     
    Joe Van Dyk, Aug 17, 2005
    #2
    1. Advertising

  3. Joe Van Dyk

    Adam Keys Guest

    On Aug 17, 2005, at 7:04 AM, Christian Neukirchen wrote:
    >
    > ruby myxmloutput | xmllint --format -


    Or, with XML Starlet[1]:

    ruby myxmloutput | xml fo

    And, one of my favorite IRB recipes:

    irb(main):001:0> require 'net/http'
    irb(main):002:0> url = 'http://example.com/some.xml'
    irb(main):003:0> xml = Net::HTTP.get(URI.parse(url))
    irb(main):004:0> IO.popen('pbcopy', 'w') { |io| io.write(xml) }

    pbcopy puts text in the clipboard on OS X. Cygwin has a similar
    command called getclip. Not sure what's available for Linux. Its
    pretty durn handy though!

    [1] http://xmlstar.sourceforge.net/

    --
    ~akk
    http://therealadam.com
     
    Adam Keys, Aug 18, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jason Kratz

    xmlrpc server on red hat 9 question

    Jason Kratz, Jun 29, 2003, in forum: Python
    Replies:
    0
    Views:
    780
    Jason Kratz
    Jun 29, 2003
  2. Etienne Posthumus
    Replies:
    1
    Views:
    1,131
    Roger Binns
    Apr 1, 2004
  3. Replies:
    0
    Views:
    354
  4. David Hirschfield

    Question about xmlrpc and threading

    David Hirschfield, Feb 15, 2006, in forum: Python
    Replies:
    3
    Views:
    380
    Martin P. Hellwig
    Feb 16, 2006
  5. fortepianissimo
    Replies:
    1
    Views:
    378
    fortepianissimo
    Oct 23, 2006
Loading...

Share This Page