Class: SOAP::RPC::Driver
- Includes:
- AttrProxy
- Defined in:
- lib/soap/rpc/driver.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#proxy ⇒ Object
readonly
Returns the value of attribute proxy.
-
#soapaction ⇒ Object
Returns the value of attribute soapaction.
Instance Method Summary collapse
- #add_document_method(name, soapaction, req_qname, res_qname) ⇒ Object
- #add_document_operation(soapaction, name, param_def, opt = {}) ⇒ Object
- #add_rpc_method(name, *params) ⇒ Object (also: #add_method)
- #add_rpc_method_as(name, name_as, *params) ⇒ Object (also: #add_method_as)
- #add_rpc_method_with_soapaction(name, soapaction, *params) ⇒ Object (also: #add_method_with_soapaction)
- #add_rpc_method_with_soapaction_as(name, name_as, soapaction, *params) ⇒ Object (also: #add_method_with_soapaction_as)
- #add_rpc_operation(qname, soapaction, name, param_def, opt = {}) ⇒ Object
- #call(name, *params) ⇒ Object
- #httpproxy ⇒ Object
- #httpproxy=(httpproxy) ⇒ Object
-
#initialize(endpoint_url, namespace = nil, soapaction = nil) ⇒ Driver
constructor
A new instance of Driver.
- #inspect ⇒ Object
- #invoke(headers, body) ⇒ Object
- #loadproperty(propertyname) ⇒ Object
- #mandatorycharset ⇒ Object
- #mandatorycharset=(mandatorycharset) ⇒ Object
- #wiredump_dev ⇒ Object
- #wiredump_dev=(wiredump_dev) ⇒ Object
- #wiredump_file_base ⇒ Object
- #wiredump_file_base=(wiredump_file_base) ⇒ Object
Methods included from AttrProxy
Constructor Details
#initialize(endpoint_url, namespace = nil, soapaction = nil) ⇒ Driver
Returns a new instance of Driver.
81 82 83 84 85 86 87 |
# File 'lib/soap/rpc/driver.rb', line 81 def initialize(endpoint_url, namespace = nil, soapaction = nil) @namespace = namespace @soapaction = soapaction @options = @wiredump_file_base = nil @proxy = Proxy.new(endpoint_url, @soapaction, @options) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
42 43 44 |
# File 'lib/soap/rpc/driver.rb', line 42 def @options end |
#proxy ⇒ Object (readonly)
Returns the value of attribute proxy.
41 42 43 |
# File 'lib/soap/rpc/driver.rb', line 41 def proxy @proxy end |
#soapaction ⇒ Object
Returns the value of attribute soapaction.
43 44 45 |
# File 'lib/soap/rpc/driver.rb', line 43 def soapaction @soapaction end |
Instance Method Details
#add_document_method(name, soapaction, req_qname, res_qname) ⇒ Object
120 121 122 123 124 |
# File 'lib/soap/rpc/driver.rb', line 120 def add_document_method(name, soapaction, req_qname, res_qname) param_def = SOAPMethod.create_doc_param_def(req_qname, res_qname) @proxy.add_document_method(soapaction, name, param_def) add_document_method_interface(name, param_def) end |
#add_document_operation(soapaction, name, param_def, opt = {}) ⇒ Object
131 132 133 134 |
# File 'lib/soap/rpc/driver.rb', line 131 def add_document_operation(soapaction, name, param_def, opt = {}) @proxy.add_document_operation(soapaction, name, param_def, opt) add_document_method_interface(name, param_def) end |
#add_rpc_method(name, *params) ⇒ Object Also known as: add_method
95 96 97 |
# File 'lib/soap/rpc/driver.rb', line 95 def add_rpc_method(name, *params) add_rpc_method_with_soapaction_as(name, name, @soapaction, *params) end |
#add_rpc_method_as(name, name_as, *params) ⇒ Object Also known as: add_method_as
99 100 101 |
# File 'lib/soap/rpc/driver.rb', line 99 def add_rpc_method_as(name, name_as, *params) add_rpc_method_with_soapaction_as(name, name_as, @soapaction, *params) end |
#add_rpc_method_with_soapaction(name, soapaction, *params) ⇒ Object Also known as: add_method_with_soapaction
103 104 105 |
# File 'lib/soap/rpc/driver.rb', line 103 def add_rpc_method_with_soapaction(name, soapaction, *params) add_rpc_method_with_soapaction_as(name, name, soapaction, *params) end |
#add_rpc_method_with_soapaction_as(name, name_as, soapaction, *params) ⇒ Object Also known as: add_method_with_soapaction_as
107 108 109 110 111 112 |
# File 'lib/soap/rpc/driver.rb', line 107 def add_rpc_method_with_soapaction_as(name, name_as, soapaction, *params) param_def = SOAPMethod.create_rpc_param_def(params) qname = XSD::QName.new(@namespace, name_as) @proxy.add_rpc_method(qname, soapaction, name, param_def) add_rpc_method_interface(name, param_def) end |
#add_rpc_operation(qname, soapaction, name, param_def, opt = {}) ⇒ Object
126 127 128 129 |
# File 'lib/soap/rpc/driver.rb', line 126 def add_rpc_operation(qname, soapaction, name, param_def, opt = {}) @proxy.add_rpc_operation(qname, soapaction, name, param_def, opt) add_rpc_method_interface(name, param_def) end |
#call(name, *params) ⇒ Object
149 150 151 152 |
# File 'lib/soap/rpc/driver.rb', line 149 def call(name, *params) set_wiredump_file_base(name) @proxy.call(name, *params) end |
#httpproxy ⇒ Object
49 50 51 |
# File 'lib/soap/rpc/driver.rb', line 49 def httpproxy ["protocol.http.proxy"] end |
#httpproxy=(httpproxy) ⇒ Object
53 54 55 |
# File 'lib/soap/rpc/driver.rb', line 53 def httpproxy=(httpproxy) ["protocol.http.proxy"] = httpproxy end |
#inspect ⇒ Object
45 46 47 |
# File 'lib/soap/rpc/driver.rb', line 45 def inspect "#<#{self.class}:#{@proxy.inspect}>" end |
#invoke(headers, body) ⇒ Object
136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/soap/rpc/driver.rb', line 136 def invoke(headers, body) if headers and !headers.is_a?(SOAPHeader) headers = create_header(headers) end set_wiredump_file_base(body.elename.name) env = @proxy.invoke(headers, body) if env.nil? return nil, nil else return env.header, env.body end end |
#loadproperty(propertyname) ⇒ Object
89 90 91 92 93 |
# File 'lib/soap/rpc/driver.rb', line 89 def loadproperty(propertyname) unless .loadproperty(propertyname) raise LoadError.new("No such property to load -- #{propertyname}") end end |
#mandatorycharset ⇒ Object
65 66 67 |
# File 'lib/soap/rpc/driver.rb', line 65 def mandatorycharset ["protocol.mandatorycharset"] end |
#mandatorycharset=(mandatorycharset) ⇒ Object
69 70 71 |
# File 'lib/soap/rpc/driver.rb', line 69 def mandatorycharset=(mandatorycharset) ["protocol.mandatorycharset"] = mandatorycharset end |
#wiredump_dev ⇒ Object
57 58 59 |
# File 'lib/soap/rpc/driver.rb', line 57 def wiredump_dev ["protocol.http.wiredump_dev"] end |
#wiredump_dev=(wiredump_dev) ⇒ Object
61 62 63 |
# File 'lib/soap/rpc/driver.rb', line 61 def wiredump_dev=(wiredump_dev) ["protocol.http.wiredump_dev"] = wiredump_dev end |
#wiredump_file_base ⇒ Object
73 74 75 |
# File 'lib/soap/rpc/driver.rb', line 73 def wiredump_file_base ["protocol.wiredump_file_base"] end |
#wiredump_file_base=(wiredump_file_base) ⇒ Object
77 78 79 |
# File 'lib/soap/rpc/driver.rb', line 77 def wiredump_file_base=(wiredump_file_base) ["protocol.wiredump_file_base"] = wiredump_file_base end |