ysriram wrote:
> How to make the marshaller use proper element names instead of Ruby
> class names.
>
> Example
>
> my-class instead of MyClass
Example;
class Pair
attr_reader :first
attr_reader :second
def initialize(first = nil, second = nil)
@first = first
@second = second
end
end
obj = Pair.new("first", "second")
puts '== normal SOAP marshaller =='
require 'soap/marshal'
puts SOAP::Marshal.marshal(obj)
puts
puts '== simple xsd mapper =='
require 'xsd/mapping'
puts XSD::Mapping.obj2xml(obj, 'my-pair')
puts
puts '== self marshalling =='
require 'soap/marshal'
soap_obj = SOAP::Mapping.obj2soap(obj)
soap_obj.elename = XSD::QName.new(nil, 'my-pair')
puts SOAP::Processor.marshal(
SOAP::SOAPEnvelope.new(nil, SOAP::SOAPBody.new(soap_obj)))
Regards,
// NaHi