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.

Constant Summary collapse

XSD_BUILTIN_TYPES =

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.

XSD built-in simple and complex types per XML Schema Part 2 §3.

Returns:

  • (Set<String>)
Set.new(%w[
  anyType anySimpleType
  string normalizedString token language Name NCName ID IDREF IDREFS
  ENTITY ENTITIES NMTOKEN NMTOKENS
  boolean
  decimal integer nonPositiveInteger negativeInteger long int short byte
  nonNegativeInteger unsignedLong unsignedInt unsignedShort unsignedByte positiveInteger
  float double
  duration dateTime time date gYearMonth gYear gMonthDay gDay gMonth
  hexBinary base64Binary
  anyURI QName NOTATION
]).freeze

Instance Method Summary collapse

Methods included from Log

#logger

Constructor Details

#initialize(schemas, limits: nil, issues: 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:

  • schemas (Schema::Collection)

    the schema collection for resolving types

  • limits (Limits, nil) (defaults to: nil)

    resource limits for DoS protection. If nil, uses Limits defaults.

  • issues (Array, nil) (defaults to: nil)

    optional issues collector for recording build problems



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

def initialize(schemas, limits: nil, issues: nil)
  @schemas = schemas
  @limits = limits || Limits.new
  @issues = issues
  @depth_exceeded = false
  @type_cache = {}
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:

  • parts (Array<Hash>)

    the message parts to build elements from

Returns:

  • (Array<Element>)

    the built element trees

Raises:



57
58
59
60
61
62
63
64
65
66
# File 'lib/wsdl/xml/element_builder.rb', line 57

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