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).

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.

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')



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/wsdl/parser/binding_operation.rb', line 19

def initialize(operation_node, defaults = {})
  @operation_node = operation_node

  if (soap_operation_node = find_soap_operation_node)
    namespace = soap_operation_node.first
    node = soap_operation_node.last

    @soap_namespace = namespace
    @soap_action = node['soapAction']
    @style = node['style'] || defaults[:style]
  end
end

Instance Attribute Details

#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



33
34
35
# File 'lib/wsdl/parser/binding_operation.rb', line 33

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)



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

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')



36
37
38
# File 'lib/wsdl/parser/binding_operation.rb', line 36

def style
  @style
end

Instance Method Details

#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



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/wsdl/parser/binding_operation.rb', line 73

def input_body
  return @input_body if @input_body

  input_body = {}

  if (body_node = find_input_child_nodes('body').first)
    input_body = {
      encoding_style: body_node['encodingStyle'],
      namespace: body_node['namespace'],
      use: body_node['use']
    }
  end

  @input_body = input_body
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:



58
59
60
61
62
63
# File 'lib/wsdl/parser/binding_operation.rb', line 58

def input_headers
  return @input_headers if @input_headers

  header_nodes = find_input_child_nodes('header') || []
  @input_headers = build_headers(header_nodes)
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



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

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



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/wsdl/parser/binding_operation.rb', line 114

def output_body
  return @output_body if @output_body

  output_body = {}

  if (body_node = find_output_child_nodes('body').first)
    output_body = {
      encoding_style: body_node['encodingStyle'],
      namespace: body_node['namespace'],
      use: body_node['use']
    }
  end

  @output_body = output_body
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:



99
100
101
102
103
104
# File 'lib/wsdl/parser/binding_operation.rb', line 99

def output_headers
  return @output_headers if @output_headers

  header_nodes = find_output_child_nodes('header') || []
  @output_headers = build_headers(header_nodes)
end