I have a WSDL and used to wsdl2ruby to create the default.rb and
defaultdriver.rb
the method that i’m calling class representation is:
{http://home.setup/abs}DeliverMessage
class DeliverMessage
@@schema_type = “DeliverMessage”
@@schema_ns = “http://home.setup/abs”
@@schema_qualified = “true”
@@schema_element = [[“absInputParams”, “ArrayOfAbsParam”]]
attr_accessor :absInputParams
def initialize(absInputParams = nil)
@absInputParams = absInputParams
end
end
the absInputParams structure class representation is
{http://home.setup.org/absParam.xsd}absParam
class AbsParam
@@schema_type = “absParam”
@@schema_ns = “http://home.setup.org/absParam.xsd”
@@schema_attribute = {XSD::QName.new(nil, “Name”) =>
“SOAP::SOAPString”}
@@schema_element = [[“value”, [nil,
XSD::QName.new(“http://home.setup.org/absParam.xsd”, “Value”)]]]
def Value
@value
end
def Value=(value)
@value = value
end
def xmlattr_Name
(@__xmlattr ||= {})[XSD::QName.new(nil, “Name”)]
end
def xmlattr_Name=(value)
(@__xmlattr ||= {})[XSD::QName.new(nil, “Name”)] = value
end
def initialize(value = nil)
@value = value
@__xmlattr = {}
end
end
the Array of absInputParams structure class representation is
{http://home.setup.org/absParam.xsd}ArrayOfAbsParam
class ArrayOfAbsParam < ::Array
@@schema_type = “absParam”
@@schema_ns = “http://home.setup.org/absParam.xsd”
@@schema_element = [[“absInputParam”, [“AbsParam[]”,
XSD::QName.new(“http://home.setup/abs”, “absInputParam”)]]]
end
My Question is :
How can I build an absParam item in absInputParams array (input for
initialize of DeliverMessage)?
I tried to:
parameters=nil
parameters =DeliverMessage.new
parameters.absInputParams =[]
parameters.absInputParams[0] =AbsParam.new(‘a’)
parameters.absInputParams[0].xmlattr_Name=‘Dingo’
puts obj.deliverMessage(parameters)
my problem is : xmlattr_Name, since I know that the “Name” property of
AbpParam is a .Net
System.Xml.Serialization.XmlAttributeAttribute() , how can I set the
value?
thanks.
xaimo