Xaimo Any day now
2006-Aug-01 16:34 UTC
[Rails] xmlattr use .net web service from ruby problem
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
--
Posted via http://www.ruby-forum.com/.
Xaimo Any day now
2006-Aug-02 16:22 UTC
[Rails] Re: xmlattr use .net web service from ruby problem
I have fixed that,
Now I''m getting a weird response:
C:/ruby/lib/ruby/1.8/soap/mapping/wsdlliteralregistry.rb:71: warning:
Object#typ
e is deprecated; use Object#class
C:/ruby/lib/ruby/1.8/soap/mapping/wsdlliteralregistry.rb:71:in
`soap2obj'': canno
t map SOAP::SOAPElement to Ruby object (SOAP::Mapping::MappingError)
from C:/ruby/lib/ruby/1.8/soap/mapping/mapping.rb:146:in
`_soap2obj''
from C:/ruby/lib/ruby/1.8/soap/mapping/mapping.rb:59:in
`soap2obj''
from C:/ruby/lib/ruby/1.8/soap/mapping/mapping.rb:360:in
`protect_thread
vars''
from C:/ruby/lib/ruby/1.8/soap/mapping/mapping.rb:55:in
`soap2obj''
from C:/ruby/lib/ruby/1.8/soap/rpc/proxy.rb:479:in
`response_doc_lit''
from C:/ruby/lib/ruby/1.8/soap/mapping/mapping.rb:351:in
`collect''
from C:/ruby/lib/ruby/1.8/soap/baseData.rb:475:in `each''
from C:/ruby/lib/ruby/1.8/soap/rpc/proxy.rb:478:in
`response_doc_lit''
from C:/ruby/lib/ruby/1.8/soap/rpc/proxy.rb:444:in
`response_doc''
from C:/ruby/lib/ruby/1.8/soap/rpc/proxy.rb:348:in
`response_obj''
from C:/ruby/lib/ruby/1.8/soap/rpc/proxy.rb:149:in `call''
from C:/ruby/lib/ruby/1.8/soap/rpc/driver.rb:178:in `call''
from C:/ruby/lib/ruby/1.8/soap/rpc/driver.rb:232:in
`deliverPlainMessage
Any Ideas?
thanks,
xaimo.
--
Posted via http://www.ruby-forum.com/.