Class: WSDL::Parser::Port Private
- Inherits:
-
Object
- Object
- WSDL::Parser::Port
- Defined in:
- lib/wsdl/parser/port.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 port element within a service.
A port defines a single endpoint for a service by associating a binding with a network address. It specifies where and how to communicate with the service using a particular protocol binding.
Instance Attribute Summary collapse
-
#binding ⇒ String
readonly
private
The qualified name of the binding this port uses.
-
#location ⇒ String
readonly
private
The endpoint URL for this port.
-
#name ⇒ String
readonly
private
The name of this port.
-
#type ⇒ String
readonly
private
The SOAP namespace URI indicating the protocol version.
Instance Method Summary collapse
-
#fetch_binding(documents) ⇒ Binding
private
Fetches the binding that this port references.
-
#initialize(port_node, soap_node) ⇒ Port
constructor
private
Creates a new Port from WSDL port and SOAP address XML nodes.
-
#to_hash ⇒ Hash
private
Converts this port to a Hash representation.
Constructor Details
#initialize(port_node, soap_node) ⇒ Port
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 Port from WSDL port and SOAP address XML nodes.
18 19 20 21 22 23 24 25 |
# File 'lib/wsdl/parser/port.rb', line 18 def initialize(port_node, soap_node) @port_node = port_node @name = port_node['name'] @binding = port_node['binding'] @type = soap_node.namespace.href @location = soap_node['location'] end |
Instance Attribute Details
#binding ⇒ String (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 binding this port uses.
31 32 33 |
# File 'lib/wsdl/parser/port.rb', line 31 def binding @binding end |
#location ⇒ String (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 endpoint URL for this port.
37 38 39 |
# File 'lib/wsdl/parser/port.rb', line 37 def location @location end |
#name ⇒ String (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 port.
28 29 30 |
# File 'lib/wsdl/parser/port.rb', line 28 def name @name end |
#type ⇒ String (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 indicating the protocol version.
34 35 36 |
# File 'lib/wsdl/parser/port.rb', line 34 def type @type end |
Instance Method Details
#fetch_binding(documents) ⇒ 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.
Fetches the binding that this port references.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/wsdl/parser/port.rb', line 44 def fetch_binding(documents) binding_name = QName.parse( @binding, namespaces: @port_node.namespaces, default_namespace: QName.document_namespace(@port_node.document.root) ) documents.bindings.fetch(binding_name) do raise UnresolvedReferenceError.new( "Unable to find binding #{binding_name} for port #{@name.inspect}", reference_type: :binding, reference_name: binding_name.to_s, context: "port #{@name.inspect}" ) end end |
#to_hash ⇒ Hash
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.
Converts this port to a Hash representation.
68 69 70 |
# File 'lib/wsdl/parser/port.rb', line 68 def to_hash { name => { type: type, location: location } } end |