Class: SOAP::RPC::Proxy::Operation
Instance Attribute Summary collapse
-
#attributeformdefault ⇒ Object
readonly
Returns the value of attribute attributeformdefault.
-
#elementformdefault ⇒ Object
readonly
Returns the value of attribute elementformdefault.
-
#request_style ⇒ Object
readonly
Returns the value of attribute request_style.
-
#request_use ⇒ Object
readonly
Returns the value of attribute request_use.
-
#response_style ⇒ Object
readonly
Returns the value of attribute response_style.
-
#response_use ⇒ Object
readonly
Returns the value of attribute response_use.
-
#soapaction ⇒ Object
readonly
Returns the value of attribute soapaction.
Instance Method Summary collapse
-
#initialize(soapaction, param_def, opt) ⇒ Operation
constructor
A new instance of Operation.
- #raise_fault(e, mapping_registry, literal_mapping_registry) ⇒ Object
- #request_body(values, mapping_registry, literal_mapping_registry, opt) ⇒ Object
- #request_default_encodingstyle ⇒ Object
- #response_default_encodingstyle ⇒ Object
- #response_obj(body, mapping_registry, literal_mapping_registry, opt) ⇒ Object
Constructor Details
#initialize(soapaction, param_def, opt) ⇒ Operation
Returns a new instance of Operation.
341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
# File 'lib/soap/rpc/proxy.rb', line 341 def initialize(soapaction, param_def, opt) @soapaction = soapaction @request_style = opt[:request_style] @response_style = opt[:response_style] @request_use = opt[:request_use] @response_use = opt[:response_use] # set nil(unqualified) by default @elementformdefault = opt[:elementformdefault] @attributeformdefault = opt[:attributeformdefault] check_style(@request_style) check_style(@response_style) check_use(@request_use) check_use(@response_use) if @request_style == :rpc @rpc_request_qname = opt[:request_qname] if @rpc_request_qname.nil? raise MethodDefinitionError.new("rpc_request_qname must be given") end @rpc_method_factory = RPC::SOAPMethodRequest.new(@rpc_request_qname, param_def, @soapaction) else @doc_request_qnames = [] @doc_request_qualified = [] @doc_response_qnames = [] @doc_response_qualified = [] param_def.each do |inout, paramname, typeinfo, eleinfo| klass_not_used, nsdef, namedef = typeinfo qualified = eleinfo if namedef.nil? raise MethodDefinitionError.new("qname must be given") end case inout when SOAPMethod::IN @doc_request_qnames << XSD::QName.new(nsdef, namedef) @doc_request_qualified << qualified when SOAPMethod::OUT @doc_response_qnames << XSD::QName.new(nsdef, namedef) @doc_response_qualified << qualified else raise MethodDefinitionError.new( "illegal inout definition for document style: #{inout}") end end end end |
Instance Attribute Details
#attributeformdefault ⇒ Object (readonly)
Returns the value of attribute attributeformdefault.
339 340 341 |
# File 'lib/soap/rpc/proxy.rb', line 339 def attributeformdefault @attributeformdefault end |
#elementformdefault ⇒ Object (readonly)
Returns the value of attribute elementformdefault.
338 339 340 |
# File 'lib/soap/rpc/proxy.rb', line 338 def elementformdefault @elementformdefault end |
#request_style ⇒ Object (readonly)
Returns the value of attribute request_style.
334 335 336 |
# File 'lib/soap/rpc/proxy.rb', line 334 def request_style @request_style end |
#request_use ⇒ Object (readonly)
Returns the value of attribute request_use.
336 337 338 |
# File 'lib/soap/rpc/proxy.rb', line 336 def request_use @request_use end |
#response_style ⇒ Object (readonly)
Returns the value of attribute response_style.
335 336 337 |
# File 'lib/soap/rpc/proxy.rb', line 335 def response_style @response_style end |
#response_use ⇒ Object (readonly)
Returns the value of attribute response_use.
337 338 339 |
# File 'lib/soap/rpc/proxy.rb', line 337 def response_use @response_use end |
#soapaction ⇒ Object (readonly)
Returns the value of attribute soapaction.
333 334 335 |
# File 'lib/soap/rpc/proxy.rb', line 333 def soapaction @soapaction end |
Instance Method Details
#raise_fault(e, mapping_registry, literal_mapping_registry) ⇒ Object
412 413 414 415 416 417 418 |
# File 'lib/soap/rpc/proxy.rb', line 412 def raise_fault(e, mapping_registry, literal_mapping_registry) if @response_style == :rpc Mapping.fault2exception(e, mapping_registry) else Mapping.fault2exception(e, literal_mapping_registry) end end |
#request_body(values, mapping_registry, literal_mapping_registry, opt) ⇒ Object
395 396 397 398 399 400 401 |
# File 'lib/soap/rpc/proxy.rb', line 395 def request_body(values, mapping_registry, literal_mapping_registry, opt) if @request_style == :rpc request_rpc(values, mapping_registry, literal_mapping_registry, opt) else request_doc(values, mapping_registry, literal_mapping_registry, opt) end end |
#request_default_encodingstyle ⇒ Object
387 388 389 |
# File 'lib/soap/rpc/proxy.rb', line 387 def request_default_encodingstyle (@request_use == :encoded) ? EncodingNamespace : LiteralNamespace end |
#response_default_encodingstyle ⇒ Object
391 392 393 |
# File 'lib/soap/rpc/proxy.rb', line 391 def response_default_encodingstyle (@response_use == :encoded) ? EncodingNamespace : LiteralNamespace end |
#response_obj(body, mapping_registry, literal_mapping_registry, opt) ⇒ Object
403 404 405 406 407 408 409 410 |
# File 'lib/soap/rpc/proxy.rb', line 403 def response_obj(body, mapping_registry, literal_mapping_registry, opt) if @response_style == :rpc response_rpc(body, mapping_registry, literal_mapping_registry, opt) else unique_result_for_one_element_array( response_doc(body, mapping_registry, literal_mapping_registry, opt)) end end |