Files

Class Index [+]

Quicksearch

SOAP::EncodingStyle::ASPDotNetHandler

Constants

Namespace

Public Class Methods

new(charset = nil) click to toggle source
    # File lib/soap/encodingstyle/aspDotNetHandler.rb, line 20
20:   def initialize(charset = nil)
21:     super(charset)
22:     @textbuf = ''
23:     @decode_typemap = nil
24:   end

Public Instance Methods

decode_epilogue() click to toggle source
     # File lib/soap/encodingstyle/aspDotNetHandler.rb, line 141
141:   def decode_epilogue
142:   end
decode_parent(parent, node) click to toggle source
     # File lib/soap/encodingstyle/aspDotNetHandler.rb, line 144
144:   def decode_parent(parent, node)
145:     case parent.node
146:     when SOAPUnknown
147:       newparent = parent.node.as_struct
148:       node.parent = newparent
149:       parent.replace_node(newparent)
150:       decode_parent(parent, node)
151: 
152:     when SOAPStruct
153:       data = parent.node[node.elename.name]
154:       case data
155:       when nil
156:         parent.node.add(node.elename.name, node)
157:       when SOAPArray
158:         name, type_ns = node.elename.name, node.type.namespace
159:         data.add(node)
160:         node.elename, node.type.namespace = name, type_ns
161:       else
162:         parent.node[node.elename.name] = SOAPArray.new
163:         name, type_ns = data.elename.name, data.type.namespace
164:         parent.node[node.elename.name].add(data)
165:         data.elename.name, data.type.namespace = name, type_ns
166:         name, type_ns = node.elename.name, node.type.namespace
167:         parent.node[node.elename.name].add(node)
168:         node.elename.name, node.type.namespace = name, type_ns
169:       end
170: 
171:     when SOAPArray
172:       if node.position
173:         parent.node[*(decode_arypos(node.position))] = node
174:         parent.node.sparse = true
175:       else
176:         parent.node.add(node)
177:       end
178: 
179:     when SOAPBasetype
180:       raise EncodingStyleError.new("SOAP base type must not have a child")
181: 
182:     else
183:       # SOAPUnknown does not have parent.
184:       # raise EncodingStyleError.new("illegal parent: #{parent}")
185:     end
186:   end
decode_prologue() click to toggle source
     # File lib/soap/encodingstyle/aspDotNetHandler.rb, line 138
138:   def decode_prologue
139:   end
decode_tag(ns, elename, attrs, parent) click to toggle source
     # File lib/soap/encodingstyle/aspDotNetHandler.rb, line 109
109:   def decode_tag(ns, elename, attrs, parent)
110:     @textbuf = ''
111:     o = SOAPUnknown.new(self, elename)
112:     o.parent = parent
113:     o
114:   end
decode_tag_end(ns, node) click to toggle source
     # File lib/soap/encodingstyle/aspDotNetHandler.rb, line 116
116:   def decode_tag_end(ns, node)
117:     o = node.node
118:     if o.is_a?(SOAPUnknown)
119:       newnode = o.as_string
120: #       if /\A\s*\z/ =~ @textbuf
121: #         o.as_struct
122: #       else
123: #         o.as_string
124: #       end
125:       node.replace_node(newnode)
126:       o = node.node
127:     end
128: 
129:     decode_textbuf(o)
130:     @textbuf = ''
131:   end
decode_text(ns, text) click to toggle source
     # File lib/soap/encodingstyle/aspDotNetHandler.rb, line 133
133:   def decode_text(ns, text)
134:     # @textbuf is set at decode_tag_end.
135:     @textbuf << text
136:   end
encode_data(generator, ns, data, parent) click to toggle source

encode interface.

    # File lib/soap/encodingstyle/aspDotNetHandler.rb, line 30
30:   def encode_data(generator, ns, data, parent)
31:     attrs = {}
32:     # ASPDotNetHandler is intended to be used for accessing an ASP.NET doc/lit
33:     # service as an rpc/encoded service.  in the situation, local elements
34:     # should be qualified.  propagate parent's namespace to children.
35:     if data.elename.namespace.nil?
36:       data.elename =
37:         XSD::QName.new(parent.elename.namespace, data.elename.name)
38:     end
39:     name = generator.encode_name(ns, data, attrs)
40:     case data
41:     when SOAPRawString
42:       generator.encode_tag(name, attrs)
43:       generator.encode_rawstring(data.to_s)
44:     when XSD::XSDString
45:       generator.encode_tag(name, attrs)
46:       generator.encode_string(@charset ?
47:         XSD::Charset.encoding_to_xml(data.to_s, @charset) : data.to_s)
48:     when XSD::XSDAnySimpleType
49:       generator.encode_tag(name, attrs)
50:       generator.encode_string(data.to_s)
51:     when SOAPStruct
52:       generator.encode_tag(name, attrs)
53:       data.each do |key, value|
54:         generator.encode_child(ns, value, data)
55:       end
56:     when SOAPArray
57:       generator.encode_tag(name, attrs)
58:       data.traverse do |child, *rank|
59:         data.position = nil
60:         generator.encode_child(ns, child, data)
61:       end
62:     else
63:       raise EncodingStyleError.new(
64:         "unknown object:#{data} in this encodingStyle")
65:     end
66:   end
encode_data_end(generator, ns, data, parent) click to toggle source
    # File lib/soap/encodingstyle/aspDotNetHandler.rb, line 68
68:   def encode_data_end(generator, ns, data, parent)
69:     name = generator.encode_name_end(ns, data)
70:     cr = (data.is_a?(SOAPCompoundtype) and data.have_member)
71:     generator.encode_tag_end(name, cr)
72:   end

Private Instance Methods

decode_textbuf(node) click to toggle source
     # File lib/soap/encodingstyle/aspDotNetHandler.rb, line 190
190:   def decode_textbuf(node)
191:     if node.is_a?(XSD::XSDString)
192:       if @charset
193:         node.set(XSD::Charset.encoding_from_xml(@textbuf, @charset))
194:       else
195:         node.set(@textbuf)
196:       end
197:     else
198:       # Nothing to do...
199:     end
200:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.