il 16 May 2004 15:56:19 -0700, djberg96 / hotmail.com (Daniel Berger) ha
scritto::



>Yes, I'm aware of xmarshal, but wouldn't it be cool to have that
>builtin and included as part of the stdlib?  


agreed, but maybe you did'nt noticed that we have xml marshaller :)

in SOAP:

>> require 'soap/marshal'
=> true
>> class C
>>  def initialize
>>   @a,@b=1,'ciao'
>>  end
>> end
=> nil
>> SOAP::Marshal.dump(C.new)
=> "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<env:Envelope
xmlns:xsd=\"http:
//www.w3.org/2001/XMLSchema\"\n
xmlns:env=\"http://schemas.xmlsoap.org/soap/e
nvelope/\"\n
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n  <env
:Body>\n    <C xmlns:n1=\"http://www.ruby-lang.org/xmlns/ruby/type/custom\"\n
     xsi:type=\"n1:C\"\n
env:encodingStyle=\"http://schemas.xmlsoap.org/s
oap/encoding/\">\n      <a xsi:type=\"xsd:int\">1</a>\n      <b
xsi:type=\"xsd:s
tring\">ciao</b>\n    </C>\n  </env:Body>\n</env:Envelope>"



and in XMLRPC:

>> require 'xmlrpc/marshal'
=> true
>> XMLRPC::Marshal.dump(C.new)
RuntimeError: Wrong type!
        from c:/Programmi/Ruby/lib/ruby/1.8/xmlrpc/create.rb:264:in
`conv2value'

        from c:/Programmi/Ruby/lib/ruby/1.8/xmlrpc/create.rb:136:in
`methodRespo
nse'
        from c:/Programmi/Ruby/lib/ruby/1.8/xmlrpc/create.rb:135:in
`collect'
        from c:/Programmi/Ruby/lib/ruby/1.8/xmlrpc/create.rb:135:in
`methodRespo
nse'
        from c:/Programmi/Ruby/lib/ruby/1.8/xmlrpc/marshal.rb:56:in
`dump_respon
se'
        from c:/Programmi/Ruby/lib/ruby/1.8/xmlrpc/marshal.rb:28:in
`dump'
        from (irb):11
>> class C
>>  include XMLRPC::Marshallable
>> end
=> C
>> XMLRPC::Marshal.dump(C.new)
=> "<?xml version=\"1.0\"
?><methodResponse><params><param><value><struct><membe
r><name>a</name><value><i4>1</i4></value></member><member><name>b</name><value><
string>ciao</string></value></member><member><name>___class___</name><value><str
ing>C</string></value></member></struct></value></param></params></methodRespons
e>\n"


on a sidenote I believe that XMLRPC::Marshal should work even with
ibject that quacks like Marshallable just like SOAP::Matshal do.