From: "NAKAMURA, Hiroshi" Date: 2002-03-19T10:45:02+09:00 Subject: Re: [ANN] Xml Serialization for Ruby Hi Chris, This is FYI thing, too. > From: Chris Morris [mailto:chrismo@charter.net] > Sent: Tuesday, March 19, 2002 9:52 AM > I'd rather see this xml: > > > Chris Morris > 30 > 72 > > > ... than this: > > > Chris Morris > 30 > 72 > SOAP XML instance which does not include type informations looks like the formar. For example, SOAP engine comes with ASP.NET does not dump type information by default. The engine read WSDL when load to detect those type. SOAP4R can dump typeless XML instance but cannot load it because I have not yet finished WSDL4R. sigh. require 'soap/marshal' def aspDotNetMarshal( obj ) soapObj = SOAP::RPCUtils.obj2soap( obj ) soapObj.name = obj.type.to_s soapObj.encodingStyle = SOAP::EncodingStyleHandlerASPDotNet::Namespace SOAP::Processor.marshal( nil, soapObj ) end class Person attr_accessor :name, :age, :height end o = Person.new o.name = 'NaHi' o.age = 32 o.height = 173 puts aspDotNetMarshal( o ) => NaHi 32 173