Class: WSDL::XML::ElementBuilder Private

Inherits:
Object
  • Object
show all
Includes:
Log
Defined in:
lib/wsdl/xml/element_builder.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.

Builds XML Element trees from WSDL message part definitions.

Transforms WSDL message parts into a tree of Element objects that represent the structure of SOAP messages. Resolves type references, handles complex and simple types, and detects recursive type definitions to prevent infinite loops during element building.

API:

  • private

Instance Method Summary collapse

Methods included from Log

#logger

Constructor Details

#initialize(schemas, limits: nil) ⇒ ElementBuilder

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 ElementBuilder instance.

Parameters:

  • the schema collection for resolving types

  • (defaults to: nil)

    resource limits for DoS protection. If nil, uses WSDL.limits.

API:

  • private



23
24
25
26
# File 'lib/wsdl/xml/element_builder.rb', line 23

def initialize(schemas, limits: nil)
  @schemas = schemas
  @limits = limits || WSDL.limits
end

Instance Method Details

#build(parts) ⇒ Array<Element>

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.

Builds Element trees from WSDL message parts.

Each part can reference either a type (via @type attribute) or an element (via @element attribute). Processes each part and returns the corresponding Element objects.

Parameters:

  • the message parts to build elements from

Returns:

  • the built element trees

Raises:

  • if type nesting depth exceeds limits

API:

  • private



37
38
39
40
41
42
43
44
45
# File 'lib/wsdl/xml/element_builder.rb', line 37

def build(parts)
  parts.filter_map { |part|
    if part[:type]
      build_type_element(part)
    elsif part[:element]
      build_element(part)
    end
  }
end