Parent

Files

Class Index [+]

Quicksearch

SOAP::RPC::Driver

Attributes

proxy[R]
options[R]
soapaction[RW]

Public Class Methods

__attr_proxy(symbol, assignable = false) click to toggle source
    # File lib/soap/rpc/driver.rb, line 26
26:       def __attr_proxy(symbol, assignable = false)
27:         name = symbol.to_s
28:         define_method(name) {
29:           @proxy.__send__(name)
30:         }
31:         if assignable
32:           aname = name + '='
33:           define_method(aname) { |rhs|
34:             @proxy.__send__(aname, rhs)
35:           }
36:         end
37:       end
__attr_proxy(symbol, assignable = false) click to toggle source
    # File lib/soap/rpc/driver.rb, line 39
39:       def __attr_proxy(symbol, assignable = false)
40:         name = symbol.to_s
41:         module_eval           def #{name}            @proxy.#{name}          end
42:         if assignable
43:           module_eval             def #{name}=(value)              @proxy.#{name} = value            end
44:         end
45:       end
new(endpoint_url, namespace = nil, soapaction = nil) click to toggle source
     # File lib/soap/rpc/driver.rb, line 111
111:   def initialize(endpoint_url, namespace = nil, soapaction = nil)
112:     @namespace = namespace
113:     @soapaction = soapaction
114:     @options = setup_options
115:     @wiredump_file_base = nil
116:     @proxy = Proxy.new(endpoint_url, @soapaction, @options)
117:   end

Public Instance Methods

add_document_method(name, soapaction, req_qname, res_qname) click to toggle source
     # File lib/soap/rpc/driver.rb, line 150
150:   def add_document_method(name, soapaction, req_qname, res_qname)
151:     param_def = SOAPMethod.create_doc_param_def(req_qname, res_qname)
152:     @proxy.add_document_method(soapaction, name, param_def)
153:     add_document_method_interface(name, param_def)
154:   end
add_document_operation(soapaction, name, param_def, opt = {}) click to toggle source
     # File lib/soap/rpc/driver.rb, line 161
161:   def add_document_operation(soapaction, name, param_def, opt = {})
162:     @proxy.add_document_operation(soapaction, name, param_def, opt)
163:     add_document_method_interface(name, param_def)
164:   end
add_method(name, *params) click to toggle source

add_method is for shortcut of typical rpc/encoded method definition.

Alias for: add_rpc_method
add_method_as(name, name_as, *params) click to toggle source
Alias for: add_rpc_method_as
add_method_with_soapaction(name, soapaction, *params) click to toggle source
add_method_with_soapaction_as(name, name_as, soapaction, *params) click to toggle source
add_rpc_method(name, *params) click to toggle source
     # File lib/soap/rpc/driver.rb, line 125
125:   def add_rpc_method(name, *params)
126:     add_rpc_method_with_soapaction_as(name, name, @soapaction, *params)
127:   end
Also aliased as: add_method
add_rpc_method_as(name, name_as, *params) click to toggle source
     # File lib/soap/rpc/driver.rb, line 129
129:   def add_rpc_method_as(name, name_as, *params)
130:     add_rpc_method_with_soapaction_as(name, name_as, @soapaction, *params)
131:   end
Also aliased as: add_method_as
add_rpc_method_with_soapaction(name, soapaction, *params) click to toggle source
     # File lib/soap/rpc/driver.rb, line 133
133:   def add_rpc_method_with_soapaction(name, soapaction, *params)
134:     add_rpc_method_with_soapaction_as(name, name, soapaction, *params)
135:   end
Also aliased as: add_method_with_soapaction
add_rpc_method_with_soapaction_as(name, name_as, soapaction, *params) click to toggle source
     # File lib/soap/rpc/driver.rb, line 137
137:   def add_rpc_method_with_soapaction_as(name, name_as, soapaction, *params)
138:     param_def = SOAPMethod.create_rpc_param_def(params)
139:     qname = XSD::QName.new(@namespace, name_as)
140:     @proxy.add_rpc_method(qname, soapaction, name, param_def)
141:     add_rpc_method_interface(name, param_def)
142:   end
add_rpc_operation(qname, soapaction, name, param_def, opt = {}) click to toggle source
     # File lib/soap/rpc/driver.rb, line 156
156:   def add_rpc_operation(qname, soapaction, name, param_def, opt = {})
157:     @proxy.add_rpc_operation(qname, soapaction, name, param_def, opt)
158:     add_rpc_method_interface(name, param_def)
159:   end
call(name, *params) click to toggle source
     # File lib/soap/rpc/driver.rb, line 179
179:   def call(name, *params)
180:     set_wiredump_file_base(name)
181:     @proxy.call(name, *params)
182:   end
httpproxy() click to toggle source
    # File lib/soap/rpc/driver.rb, line 79
79:   def httpproxy
80:     options["protocol.http.proxy"]
81:   end
httpproxy=(httpproxy) click to toggle source
    # File lib/soap/rpc/driver.rb, line 83
83:   def httpproxy=(httpproxy)
84:     options["protocol.http.proxy"] = httpproxy
85:   end
inspect() click to toggle source
    # File lib/soap/rpc/driver.rb, line 75
75:   def inspect
76:     "#<#{self.class}:#{@proxy.inspect}>"
77:   end
invoke(headers, body) click to toggle source
     # File lib/soap/rpc/driver.rb, line 166
166:   def invoke(headers, body)
167:     if headers and !headers.is_a?(SOAPHeader)
168:       headers = create_header(headers)
169:     end
170:     set_wiredump_file_base(body.elename.name)
171:     env = @proxy.invoke(headers, body)
172:     if env.nil?
173:       return nil, nil
174:     else
175:       return env.header, env.body
176:     end
177:   end
loadproperty(propertyname) click to toggle source
     # File lib/soap/rpc/driver.rb, line 119
119:   def loadproperty(propertyname)
120:     unless options.loadproperty(propertyname)
121:       raise LoadError.new("No such property to load -- #{propertyname}")
122:     end
123:   end
mandatorycharset() click to toggle source
    # File lib/soap/rpc/driver.rb, line 95
95:   def mandatorycharset
96:     options["protocol.mandatorycharset"]
97:   end
mandatorycharset=(mandatorycharset) click to toggle source
     # File lib/soap/rpc/driver.rb, line 99
 99:   def mandatorycharset=(mandatorycharset)
100:     options["protocol.mandatorycharset"] = mandatorycharset
101:   end
wiredump_dev() click to toggle source
    # File lib/soap/rpc/driver.rb, line 87
87:   def wiredump_dev
88:     options["protocol.http.wiredump_dev"]
89:   end
wiredump_dev=(wiredump_dev) click to toggle source
    # File lib/soap/rpc/driver.rb, line 91
91:   def wiredump_dev=(wiredump_dev)
92:     options["protocol.http.wiredump_dev"] = wiredump_dev
93:   end
wiredump_file_base() click to toggle source
     # File lib/soap/rpc/driver.rb, line 103
103:   def wiredump_file_base
104:     options["protocol.wiredump_file_base"]
105:   end
wiredump_file_base=(wiredump_file_base) click to toggle source
     # File lib/soap/rpc/driver.rb, line 107
107:   def wiredump_file_base=(wiredump_file_base)
108:     options["protocol.wiredump_file_base"] = wiredump_file_base
109:   end

Private Instance Methods

add_document_method_interface(name, param_def) click to toggle source
     # File lib/soap/rpc/driver.rb, line 223
223:   def add_document_method_interface(name, param_def)
224:     param_count = RPC::SOAPMethod.param_count(param_def, RPC::SOAPMethod::IN)
225:     add_method_interface(name, param_count)
226:   end
add_method_interface(name, param_count) click to toggle source

Mapping.define_singleton_method calls define_method with proc and it exhausts much memory for each singleton Object. just instance_eval instead of it.

     # File lib/soap/rpc/driver.rb, line 231
231:   def add_method_interface(name, param_count)
232:     instance_eval       def #{name}(*arg)        unless arg.size == #{param_count}          raise ArgumentError.new(            "wrong number of arguments (\#{arg.size} for #{param_count})")        end        call(#{name.dump}, *arg)      end
233:     self.method(name)
234:   end
add_rpc_method_interface(name, param_def) click to toggle source
     # File lib/soap/rpc/driver.rb, line 217
217:   def add_rpc_method_interface(name, param_def)
218:     param_count = RPC::SOAPMethod.param_count(param_def,
219:       RPC::SOAPMethod::IN, RPC::SOAPMethod::INOUT)
220:     add_method_interface(name, param_count)
221:   end
create_header(headers) click to toggle source
     # File lib/soap/rpc/driver.rb, line 192
192:   def create_header(headers)
193:     header = SOAPHeader.new()
194:     headers.each do |content, mustunderstand, encodingstyle|
195:       header.add(SOAPHeaderItem.new(content, mustunderstand, encodingstyle))
196:     end
197:     header
198:   end
set_wiredump_file_base(name) click to toggle source
     # File lib/soap/rpc/driver.rb, line 186
186:   def set_wiredump_file_base(name)
187:     if @wiredump_file_base
188:       @proxy.set_wiredump_file_base("#{@wiredump_file_base}_#{name}")
189:     end
190:   end
setup_options() click to toggle source
     # File lib/soap/rpc/driver.rb, line 200
200:   def setup_options
201:     if opt = Property.loadproperty(::SOAP::PropertyName)
202:       opt = opt["client"]
203:     end
204:     opt ||= Property.new
205:     opt.add_hook("protocol.mandatorycharset") do |key, value|
206:       @proxy.mandatorycharset = value
207:     end
208:     opt.add_hook("protocol.wiredump_file_base") do |key, value|
209:       @wiredump_file_base = value
210:     end
211:     opt["protocol.http.charset"] ||= XSD::Charset.xml_encoding_label
212:     opt["protocol.http.proxy"] ||= Env::HTTP_PROXY
213:     opt["protocol.http.no_proxy"] ||= Env::NO_PROXY
214:     opt
215:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.