diff options
author | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-09-15 14:33:53 +0000 |
---|---|---|
committer | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-09-15 14:33:53 +0000 |
commit | 29c5ab0b77feaf975d83ab340d7194c9c4dffc9d (patch) | |
tree | 6ac40e3bffcf1735c8b7efc0f412bccc15befa6a /lib/soap/baseData.rb | |
parent | 071c45df939e962e8cd6ecc51bd402b6a7cc91f6 (diff) | |
download | ruby-29c5ab0b77feaf975d83ab340d7194c9c4dffc9d.tar.gz |
* lib/{soap,wsdl,xsd}, test/{soap,wsdl,xsd}: imported soap4r/1.5.5.
#nnn is a ticket number at http://dev.ctor.org/soap4r
* SOAP
* allow to configure an envelope namespace of SOAP request. (#124)
TemporaryNamespace = 'http://www.w3.org/2003/05/soap-envelope'
@client.options["soap.envelope.requestnamespace"] =
TemporaryNamespace
@client.options["soap.envelope.responsenamespace"] =
TemporaryNamespace
@client.do_proc(...)
* let SOAP request XML indent space configuable. see
"soap.envelope.no_indent" option. (#130)
* let external CES configuable.
ex. client["soap.mapping.external_ces"] = 'SJIS'. $KCODE is used
by default. (#133)
external CES ::= CES used in Ruby object of client and server
internal CES ::= CES used in SOAP/OM
* add iso-8859-1 external CES support. (#106)
* fixed illegal 'qualified' handling of elements. it caused
ASP.NET inteoperability problem. (#144)
* added 'soap.envelope.use_numeric_character_reference' (boolean)
option to let query XML use numeric character reference in XML,
not plain UTF-8 character. !GoogleSearch server seems to not
allow plain UTF-8 character since 2005-08-15 update. (#147)
* SOAP::Header::SimpleHeader (de)serialization throws an exception
on !SimpleHeader.on_(in|out)bound when header is a String. so we
could not use a simple single element headerItem. fixed. thanks
to emil. (#129)
* out parameter of rpc operation did not work. (#132)
* follow HTTP redirect only if using http-access2. (#125) (#145)
* add a workaround for importing an WSDL whose path begins with
drive letter. (#115)
* WSDL
* SOAP Data which is defined as a simpletype was not mapped
correctly to Ruby obj when using wsdl2ruby.rb generated classdef
file. (#123)
* rpc/literal support. (#118)
* re-implemented local element qualify/unqualify control. handles
elementFormDefault and form in WSDL. (#119)
* Array of an element which has simpleType causes a crash. (#128)
* prarmeterOrder may not contain return part so it can be shorter
than parts size. Thanks to Hugh. (#139)
* Samples
* added !BasicAuth client sample. (#117)
* added Base64 client/server sample.
* added Flickr SOAP interface client sample. (#122)
* added !SalesForce client sample. (#135)
* updated Thawte CA certificate for !GoogleAdWords sample.
* updated a client script with the newer version made by Johan.
thanks!
* shortened long file names. (#120)
* fixed typo in authheader sample. (#129)
* updated deprecated method usage. (#138)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/soap/baseData.rb')
-rw-r--r-- | lib/soap/baseData.rb | 60 |
1 files changed, 35 insertions, 25 deletions
diff --git a/lib/soap/baseData.rb b/lib/soap/baseData.rb index 6d0f628be9..0e8b00d450 100644 --- a/lib/soap/baseData.rb +++ b/lib/soap/baseData.rb @@ -44,9 +44,9 @@ module SOAPType attr_accessor :definedtype def initialize(*arg) - super(*arg) + super @encodingstyle = nil - @elename = XSD::QName.new + @elename = XSD::QName::EMPTY @id = nil @precedents = [] @root = false @@ -82,7 +82,7 @@ module SOAPBasetype include SOAP def initialize(*arg) - super(*arg) + super end end @@ -95,7 +95,7 @@ module SOAPCompoundtype include SOAP def initialize(*arg) - super(*arg) + super end end @@ -114,7 +114,7 @@ public # Override the definition in SOAPBasetype. def initialize(obj = nil) super() - @type = XSD::QName.new + @type = XSD::QName::EMPTY @refid = nil @obj = nil __setobj__(obj) if obj @@ -178,7 +178,7 @@ class SOAPExternalReference < XSD::NSDBase def initialize super() - @type = XSD::QName.new + @type = XSD::QName::EMPTY end def referred @@ -399,7 +399,7 @@ public def initialize(type = nil) super() - @type = type || XSD::QName.new + @type = type || XSD::QName::EMPTY @array = [] @data = [] end @@ -470,8 +470,10 @@ public end def each - for i in 0..(@array.length - 1) - yield(@array[i], @data[i]) + idx = 0 + while idx < @array.length + yield(@array[idx], @data[idx]) + idx += 1 end end @@ -529,7 +531,7 @@ class SOAPElement @position = nil @extraattr = {} - @qualified = false + @qualified = nil @array = [] @data = [] @@ -598,8 +600,10 @@ class SOAPElement end def each - for i in 0..(@array.length - 1) - yield(@array[i], @data[i]) + idx = 0 + while idx < @array.length + yield(@array[idx], @data[idx]) + idx += 1 end end @@ -737,27 +741,25 @@ public " does not match rank: #{@rank}") end - for i in 0..(idxary.size - 1) - if idxary[i] + 1 > @size[i] - @size[i] = idxary[i] + 1 + idx = 0 + while idx < idxary.size + if idxary[idx] + 1 > @size[idx] + @size[idx] = idxary[idx] + 1 end + idx += 1 end data = retrieve(idxary[0, idxary.size - 1]) data[idxary.last] = value if value.is_a?(SOAPType) - value.elename = value.elename.dup_name('item') - + value.elename = ITEM_NAME # Sync type unless @type.name @type = XSD::QName.new(value.type.namespace, SOAPArray.create_arytype(value.type.name, @rank)) end - - unless value.type - value.type = @type - end + value.type ||= @type end @offset = idxary @@ -787,7 +789,7 @@ public deep_map(ele, &block) else new_obj = block.call(ele) - new_obj.elename = new_obj.elename.dup_name('item') + new_obj.elename = ITEM_NAME new_obj end end @@ -815,13 +817,15 @@ public def soap2array(ary) traverse_data(@data) do |v, *position| iteary = ary - for rank in 1..(position.size - 1) + rank = 1 + while rank < position.size idx = position[rank - 1] if iteary[idx].nil? iteary = iteary[idx] = Array.new else iteary = iteary[idx] end + rank += 1 end if block_given? iteary[position.last] = yield(v) @@ -837,21 +841,26 @@ public private + ITEM_NAME = XSD::QName.new(nil, 'item') + def retrieve(idxary) data = @data - for rank in 1..(idxary.size) + rank = 1 + while rank <= idxary.size idx = idxary[rank - 1] if data[idx].nil? data = data[idx] = Array.new else data = data[idx] end + rank += 1 end data end def traverse_data(data, rank = 1) - for idx in 0..(ranksize(rank) - 1) + idx = 0 + while idx < ranksize(rank) if rank < @rank traverse_data(data[idx], rank + 1) do |*v| v[1, 0] = idx @@ -860,6 +869,7 @@ private else yield(data[idx], idx) end + idx += 1 end end |