Class: SOAP::RPC::Router::Operation
Direct Known Subclasses
Instance Attribute Summary collapse
-
#faults ⇒ Object
readonly
Returns the value of attribute faults.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#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
- #call(env, soap_header, mapping_registry, literal_mapping_registry, opt) ⇒ Object
-
#initialize(soapaction, name, param_def, opt) ⇒ Operation
constructor
A new instance of Operation.
- #request_default_encodingstyle ⇒ Object
- #response_default_encodingstyle ⇒ Object
Constructor Details
#initialize(soapaction, name, param_def, opt) ⇒ Operation
Returns a new instance of Operation.
418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 |
# File 'lib/soap/rpc/router.rb', line 418 def initialize(soapaction, name, param_def, opt) @soapaction = soapaction @name = name @request_style = opt[:request_style] @response_style = opt[:response_style] @request_use = opt[:request_use] @response_use = opt[:response_use] @faults = opt[:faults] check_style(@request_style) check_style(@response_style) check_use(@request_use) check_use(@response_use) if @response_style == :rpc request_qname = opt[:request_qname] or raise @rpc_method_factory = RPC::SOAPMethodRequest.new(request_qname, param_def, @soapaction) @rpc_response_qname = opt[:response_qname] else @doc_request_qnames = [] @doc_response_qnames = [] param_def.each do |param| param = MethodDef.to_param(param) case param.io_type when SOAPMethod::IN @doc_request_qnames << param.qname when SOAPMethod::OUT @doc_response_qnames << param.qname else raise ArgumentError.new( "illegal inout definition for document style: #{param.io_type}") end end end end |
Instance Attribute Details
#faults ⇒ Object (readonly)
Returns the value of attribute faults.
416 417 418 |
# File 'lib/soap/rpc/router.rb', line 416 def faults @faults end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
410 411 412 |
# File 'lib/soap/rpc/router.rb', line 410 def name @name end |
#request_style ⇒ Object (readonly)
Returns the value of attribute request_style.
412 413 414 |
# File 'lib/soap/rpc/router.rb', line 412 def request_style @request_style end |
#request_use ⇒ Object (readonly)
Returns the value of attribute request_use.
414 415 416 |
# File 'lib/soap/rpc/router.rb', line 414 def request_use @request_use end |
#response_style ⇒ Object (readonly)
Returns the value of attribute response_style.
413 414 415 |
# File 'lib/soap/rpc/router.rb', line 413 def response_style @response_style end |
#response_use ⇒ Object (readonly)
Returns the value of attribute response_use.
415 416 417 |
# File 'lib/soap/rpc/router.rb', line 415 def response_use @response_use end |
#soapaction ⇒ Object (readonly)
Returns the value of attribute soapaction.
411 412 413 |
# File 'lib/soap/rpc/router.rb', line 411 def soapaction @soapaction end |
Instance Method Details
#call(env, soap_header, mapping_registry, literal_mapping_registry, opt) ⇒ Object
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 |
# File 'lib/soap/rpc/router.rb', line 461 def call(env, soap_header, mapping_registry, literal_mapping_registry, opt) if @request_style == :rpc values = request_rpc(env.body, mapping_registry, literal_mapping_registry, opt) else values = request_document(env.body, mapping_registry, literal_mapping_registry, opt) end values << soap_header unless soap_header.blank? obj = receiver.method(@name.intern) #receiver.paaAttivaRPT(*values) result = obj.call(*values) return result if result.is_a?(SOAPFault) if @response_style == :rpc response_rpc(result, mapping_registry, literal_mapping_registry, opt) elsif @doc_response_qnames.empty? # nothing to do else response_doc(result, mapping_registry, literal_mapping_registry, opt) end end |
#request_default_encodingstyle ⇒ Object
453 454 455 |
# File 'lib/soap/rpc/router.rb', line 453 def request_default_encodingstyle (@request_use == :encoded) ? EncodingNamespace : LiteralNamespace end |
#response_default_encodingstyle ⇒ Object
457 458 459 |
# File 'lib/soap/rpc/router.rb', line 457 def response_default_encodingstyle (@response_use == :encoded) ? EncodingNamespace : LiteralNamespace end |