Class: WSDL::Parser::Binding Private

Inherits:
Object
  • Object
show all
Defined in:
lib/wsdl/parser/binding.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 element.

A binding defines the message format and protocol details for operations defined by a particular port type. It specifies the concrete protocol (SOAP 1.1 or 1.2) and data format (document or RPC style) to be used.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(binding_node) ⇒ Binding

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 Binding from a WSDL binding XML node.

Parameters:

  • binding_node (Nokogiri::XML::Node)

    the wsdl:binding element



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/wsdl/parser/binding.rb', line 17

def initialize(binding_node)
  @binding_node = binding_node

  @name = binding_node['name']
  @port_type = binding_node['type']

  if (soap_node = find_soap_node)
    @style = soap_node['style'] || 'document'
    @transport = soap_node['transport']
  end
end

Instance Attribute Details

#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 of this binding.

Returns:

  • (String)

    the name of this binding



30
31
32
# File 'lib/wsdl/parser/binding.rb', line 30

def name
  @name
end

#port_typeString (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 qualified name of the port type this binding implements.

Returns:

  • (String)

    the qualified name of the port type this binding implements



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

def port_type
  @port_type
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 default style for operations ('document' or 'rpc').

Returns:

  • (String)

    the default style for operations ('document' or 'rpc')



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

def style
  @style
end

#transportString (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 transport URI (e.g., HTTP).

Returns:

  • (String)

    the transport URI (e.g., HTTP)



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

def transport
  @transport
end

Instance Method Details

#fetch_port_type(documents) ⇒ PortType

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.

Fetches the port type that this binding implements.

Parameters:

Returns:

Raises:



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/wsdl/parser/binding.rb', line 46

def fetch_port_type(documents)
  port_type_name = QName.parse(
    @port_type,
    namespaces: @binding_node.namespaces,
    default_namespace: QName.document_namespace(@binding_node.document.root)
  )

  documents.port_types.fetch(port_type_name) do
    raise UnresolvedReferenceError.new(
      "Unable to find portType #{port_type_name} for binding #{@name.inspect}",
      reference_type: :port_type,
      reference_name: port_type_name.to_s,
      context: "binding #{@name.inspect}"
    )
  end
end

#operationsHash{String => 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.

Returns the operations defined in this binding.

Returns:

  • (Hash{String => BindingOperation})

    a hash of operation names to binding operations



66
67
68
# File 'lib/wsdl/parser/binding.rb', line 66

def operations
  @operations ||= operations!
end