Nube soap::mapping::object question

I've been banging my head against the wall on this problem. I have a
soap::mapping::object result from a web service call, and all is well
except there are some XML elements in the response that are empty.
When I output these values in a UI (puts, etc) the value for those
elements always says something like #<soap::mapping::object::0x...>

How can I test this value to see if its an empty element before I
output it ? Is there a more elegant way to handle this than doing a
check for this particular string literal ? I didn't see any methods on
soap::mapping::object to determine if it has a text element or not.

Hi,

bradrover wrote:

I've been banging my head against the wall on this problem. I have a
soap::mapping::object result from a web service call, and all is well
except there are some XML elements in the response that are empty.
When I output these values in a UI (puts, etc) the value for those
elements always says something like #<soap::mapping::object::0x...>

Can you show me a sample response XML? I don't understand 'empty element'.

irb(main):001:0> require 'xsd/mapping'
=> true
irb(main):002:0> xml = <<__XML__
irb(main):003:0" <foo>
irb(main):004:0" <bar/>
irb(main):005:0" <baz>qux</baz>
irb(main):006:0" </foo>
irb(main):007:0" __XML__
=> "<foo>\n <bar/>\n <baz>qux</baz>\n</foo>\n"
irb(main):008:0> obj = XSD::Mapping.xml2obj(xml)
=> #<SOAP::Mapping::Object:0x..fdbd9b682 {}bar="" {}baz="qux">
irb(main):009:0> obj.bar
=> ""
irb(main):010:0> obj.baz
=> "qux"

Is the above 'bar' empty? Do you mean an ommitted element?

output it ? Is there a more elegant way to handle this than doing a
check for this particular string literal ? I didn't see any methods on
soap::mapping::object to determine if it has a text element or not.

Sometimes generating stub files with wsdl2ruby.rb is of help. Generated
Driver can use type information while parsing XML to help extracting
values from it.

Regards,
// NaHi