Class: WSDL::Parser::BindingOperation Private

Inherits:
Object
  • Object
show all
Defined in:
lib/wsdl/parser/binding_operation.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Represents a WSDL binding operation element.

A binding operation defines the protocol-specific details for a particular operation, including the SOAP action, style, and the format of input/output messages (headers and body).

Constant Summary collapse

EMPTY_NODES =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Shared empty frozen array used as default for header node lists.

Returns:

  • (Array)

    empty frozen array

[].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(operation_node, defaults = {}) ⇒ BindingOperation

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Creates a new BindingOperation from a WSDL operation XML node.

Categorizes all child elements in a single pass to avoid repeated Nokogiri element_children traversals and node_name allocations.

Parameters:

  • operation_node (Nokogiri::XML::Node)

    the wsdl:operation element within a binding

  • defaults (Hash) (defaults to: {})

    default values inherited from the parent binding

Options Hash (defaults):

  • :style (String)

    the default operation style ('document' or 'rpc')



27
28
29
30
31
32
33
34
35
36
# File 'lib/wsdl/parser/binding_operation.rb', line 27

def initialize(operation_node, defaults = {})
  @operation_node = operation_node
  @has_input = false
  @input_body_node = nil
  @input_header_nodes = EMPTY_NODES
  @output_body_node = nil
  @output_header_nodes = EMPTY_NODES

  categorize_children!(defaults)
end

Instance Attribute Details

#input_nameString? (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the name attribute of the input wrapper element.

Returns:

  • (String, nil)

    the name attribute of the input wrapper element



48
49
50
# File 'lib/wsdl/parser/binding_operation.rb', line 48

def input_name
  @input_name
end

#output_nameString? (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the name attribute of the output wrapper element.

Returns:

  • (String, nil)

    the name attribute of the output wrapper element



51
52
53
# File 'lib/wsdl/parser/binding_operation.rb', line 51

def output_name
  @output_name
end

#soap_actionString? (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the SOAPAction HTTP header value.

Returns:

  • (String, nil)

    the SOAPAction HTTP header value



39
40
41
# File 'lib/wsdl/parser/binding_operation.rb', line 39

def soap_action
  @soap_action
end

#soap_namespaceString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the SOAP namespace URI (1.1 or 1.2).

Returns:

  • (String)

    the SOAP namespace URI (1.1 or 1.2)



45
46
47
# File 'lib/wsdl/parser/binding_operation.rb', line 45

def soap_namespace
  @soap_namespace
end

#styleString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the operation style ('document' or 'rpc').

Returns:

  • (String)

    the operation style ('document' or 'rpc')



42
43
44
# File 'lib/wsdl/parser/binding_operation.rb', line 42

def style
  @style
end

Instance Method Details

#input?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns whether this binding operation has an input element.

Returns:

  • (Boolean)

    true if the binding operation defines an input



63
64
65
# File 'lib/wsdl/parser/binding_operation.rb', line 63

def input?
  @has_input
end

#input_bodyHash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the input body definition for this operation.

The body is represented as a Hash with keys:

  • :encoding_style - the encoding style URI
  • :namespace - the namespace URI for RPC-style messages
  • :use - 'literal' or 'encoded'

Returns:

  • (Hash)

    the input body definition



89
90
91
# File 'lib/wsdl/parser/binding_operation.rb', line 89

def input_body
  @input_body ||= build_body(@input_body_node)
end

#input_headersArray<HeaderReference>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the input header definitions for this operation.

Each header is represented as a Hash with keys:

  • encoding_style - the encoding style URI
  • namespace - the namespace URI
  • use - 'literal' or 'encoded'
  • message - the message name (qualified)
  • part - the part name within the message

Returns:



77
78
79
# File 'lib/wsdl/parser/binding_operation.rb', line 77

def input_headers
  @input_headers ||= @input_header_nodes.map { |node| HeaderReference.from_node(node) }
end

#nameString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the name of this operation.

Returns:

  • (String)

    the operation name



56
57
58
# File 'lib/wsdl/parser/binding_operation.rb', line 56

def name
  @operation_node['name']
end

#output_bodyHash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the output body definition for this operation.

The body is represented as a Hash with keys:

  • :encoding_style - the encoding style URI
  • :namespace - the namespace URI for RPC-style messages
  • :use - 'literal' or 'encoded'

Returns:

  • (Hash)

    the output body definition



115
116
117
# File 'lib/wsdl/parser/binding_operation.rb', line 115

def output_body
  @output_body ||= build_body(@output_body_node)
end

#output_headersArray<HeaderReference>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the output header definitions for this operation.

Each header is represented as a Hash with keys:

  • encoding_style - the encoding style URI
  • namespace - the namespace URI
  • use - 'literal' or 'encoded'
  • message - the message name (qualified)
  • part - the part name within the message

Returns:



103
104
105
# File 'lib/wsdl/parser/binding_operation.rb', line 103

def output_headers
  @output_headers ||= @output_header_nodes.map { |node| HeaderReference.from_node(node) }
end