### Home Classes Methods

### In Files

- lib/wsdl/xmlSchema/complexType.rb
- lib/wsdl/soap/complexType.rb

### Parent

Info

### Methods

- ::new
- #all_elements=
- #attributes
- #base
- #check_type
- #child_defined_complextype
- #child_type
- #choice?
- #compoundtype
- #elementformdefault
- #elements
- #find_aryelement
- #find_arytype
- #find_element
- #find_element_by_name
- #find_soapenc_arytype
- #have_any?
- #nested_elements
- #parse_attr
- #parse_element
- #sequence_elements=
- #targetnamespace

### Files

- README.rdoc

### Class/Module Index

Quicksearch

- SOAP
- SOAP::ArrayIndexOutOfBoundsError
- SOAP::ArrayStoreError
- SOAP::Attachment
- SOAP::AttrProxy
- SOAP::AttrProxy::AttrProxyClassSupport
- SOAP::EmptyResponseError
- SOAP::EncodingStyle
- SOAP::EncodingStyle::ASPDotNetHandler
- SOAP::EncodingStyle::ASPDotNetHandler::SOAPTemporalObject
- SOAP::EncodingStyle::ASPDotNetHandler::SOAPUnknown
- SOAP::EncodingStyle::Handler
- SOAP::EncodingStyle::Handler::EncodingStyleError
- SOAP::EncodingStyle::LiteralHandler
- SOAP::EncodingStyle::SOAPHandler
- SOAP::EncodingStyle::SOAPHandler::SOAPTemporalObject
- SOAP::EncodingStyle::SOAPHandler::SOAPUnknown
- SOAP::Env
- SOAP::Error
- SOAP::FaultCode
- SOAP::FaultError
- SOAP::Filter
- SOAP::Filter::FilterChain
- SOAP::Filter::Handler
- SOAP::Filter::StreamHandler
- SOAP::Generator
- SOAP::Generator::FormatEncodeError
- SOAP::HTTPConfigLoader
- SOAP::HTTPStreamError
- SOAP::HTTPStreamHandler
- SOAP::HTTPStreamHandler::Client
- SOAP::HTTPStreamHandler::HttpPostRequestFilter
- SOAP::Header
- SOAP::Header::Handler
- SOAP::Header::HandlerSet
- SOAP::Header::MappingHandler
- SOAP::Header::SimpleHandler
- SOAP::MIMEMessage
- SOAP::MIMEMessage::Header
- SOAP::MIMEMessage::Headers
- SOAP::MIMEMessage::MIMEMessageError
- SOAP::MIMEMessage::Part
- SOAP::MPostUnavailableError
- SOAP::Mapping
- SOAP::Mapping::ArrayFactory_
- SOAP::Mapping::AttachmentFactory
- SOAP::Mapping::Base64Factory_
- SOAP::Mapping::BasetypeFactory_
- SOAP::Mapping::DateTimeFactory_
- SOAP::Mapping::EncodedRegistry
- SOAP::Mapping::EncodedRegistry::Map
- SOAP::Mapping::Factory
- SOAP::Mapping::FixnumFactory_
- SOAP::Mapping::HashFactory_
- SOAP::Mapping::LiteralRegistry
- SOAP::Mapping::MappedException
- SOAP::Mapping::MappingError
- SOAP::Mapping::Object
- SOAP::Mapping::Registry
- SOAP::Mapping::RegistrySupport
- SOAP::Mapping::RubytypeFactory
- SOAP::Mapping::SOAPException
- SOAP::Mapping::SchemaChoiceDefinition
- SOAP::Mapping::SchemaComplexTypeDefinition
- SOAP::Mapping::SchemaDefinition
- SOAP::Mapping::SchemaElementDefinition
- SOAP::Mapping::SchemaEmptyDefinition
- SOAP::Mapping::SchemaSequenceDefinition
- SOAP::Mapping::StringFactory_
- SOAP::Mapping::TraverseSupport
- SOAP::Mapping::TypedArrayFactory_
- SOAP::Mapping::TypedStructFactory_
- SOAP::Mapping::URIFactory_
- SOAP::Mapping::WSDLEncodedRegistry
- SOAP::Mapping::WSDLLiteralRegistry
- SOAP::Marshal
- SOAP::Marshal
- SOAP::Marshallable
- SOAP::NS
- SOAP::NestedException
- SOAP::NetHttpClient
- SOAP::NetHttpClient::Response
- SOAP::NetHttpClient::SessionManager
- SOAP::Parser
- SOAP::Parser::FormatDecodeError
- SOAP::Parser::ParseError
- SOAP::Parser::ParseFrame
- SOAP::Parser::ParseFrame::NodeContainer
- SOAP::Parser::UnexpectedElementError
- SOAP::PostUnavailableError
- SOAP::Processor
- SOAP::Property
- SOAP::Property::Util
- SOAP::RPC
- SOAP::RPC::CGIStub
- SOAP::RPC::CGIStub::SOAPFCGIRequest
- SOAP::RPC::CGIStub::SOAPRequest
- SOAP::RPC::CGIStub::SOAPStdinRequest
- SOAP::RPC::Driver
- SOAP::RPC::HTTPServer
- SOAP::RPC::MethodDef
- SOAP::RPC::MethodDef::Parameter
- SOAP::RPC::MethodDefinitionError
- SOAP::RPC::ParameterError
- SOAP::RPC::Proxy
- SOAP::RPC::Proxy::Operation
- SOAP::RPC::RPCError
- SOAP::RPC::Router
- SOAP::RPC::Router::ApplicationScopeOperation
- SOAP::RPC::Router::Operation
- SOAP::RPC::Router::RequestScopeOperation
- SOAP::RPC::SOAPMethod
- SOAP::RPC::SOAPMethodRequest
- SOAP::RPC::SOAPMethodResponse
- SOAP::RPC::SOAPVoid
- SOAP::RPC::SOAPlet
- SOAP::RPC::StandaloneServer
- SOAP::RPCRoutingError
- SOAP::ResponseFormatError
- SOAP::SOAPAnySimpleType
- SOAP::SOAPAnyURI
- SOAP::SOAPArray
- SOAP::SOAPAttachment
- SOAP::SOAPBase64
- SOAP::SOAPBasetype
- SOAP::SOAPBody
- SOAP::SOAPBoolean
- SOAP::SOAPByte
- SOAP::SOAPCompoundtype
- SOAP::SOAPDate
- SOAP::SOAPDateTime
- SOAP::SOAPDecimal
- SOAP::SOAPDouble
- SOAP::SOAPDuration
- SOAP::SOAPENTITIES
- SOAP::SOAPENTITY
- SOAP::SOAPElement
- SOAP::SOAPEnvelope
- SOAP::SOAPEnvelopeElement
- SOAP::SOAPExternalReference
- SOAP::SOAPFault
- SOAP::SOAPFloat
- SOAP::SOAPGDay
- SOAP::SOAPGMonth
- SOAP::SOAPGMonthDay
- SOAP::SOAPGYear
- SOAP::SOAPGYearMonth
- SOAP::SOAPHeader
- SOAP::SOAPHeaderItem
- SOAP::SOAPHexBinary
- SOAP::SOAPID
- SOAP::SOAPIDREF
- SOAP::SOAPIDREFS
- SOAP::SOAPInt
- SOAP::SOAPInteger
- SOAP::SOAPLanguage
- SOAP::SOAPLong
- SOAP::SOAPModuleUtils
- SOAP::SOAPNCName
- SOAP::SOAPNMTOKEN
- SOAP::SOAPNMTOKENS
- SOAP::SOAPName
- SOAP::SOAPNameAccessible
- SOAP::SOAPNegativeInteger
- SOAP::SOAPNil
- SOAP::SOAPNonNegativeInteger
- SOAP::SOAPNonPositiveInteger
- SOAP::SOAPNormalizedString
- SOAP::SOAPPositiveInteger
- SOAP::SOAPQName
- SOAP::SOAPREXMLElementWrap
- SOAP::SOAPRawData
- SOAP::SOAPRawString
- SOAP::SOAPReference
- SOAP::SOAPShort
- SOAP::SOAPString
- SOAP::SOAPStruct
- SOAP::SOAPTime
- SOAP::SOAPToken
- SOAP::SOAPType
- SOAP::SOAPUnsignedByte
- SOAP::SOAPUnsignedInt
- SOAP::SOAPUnsignedLong
- SOAP::SOAPUnsignedShort
- SOAP::StreamError
- SOAP::StreamHandler
- SOAP::StreamHandler::ConnectionData
- SOAP::UnhandledMustUnderstandHeaderError
- SOAP::WSDLDriverFactory
- SOAP::WSDLDriverFactory::FactoryError
- WSDL
- WSDL::Binding
- WSDL::Definitions
- WSDL::Documentation
- WSDL::Error
- WSDL::Import
- WSDL::Importer
- WSDL::Info
- WSDL::Message
- WSDL::Operation
- WSDL::OperationBinding
- WSDL::OperationBinding::BoundId
- WSDL::OperationBinding::OperationInfo
- WSDL::OperationBinding::Part
- WSDL::Param
- WSDL::Parser
- WSDL::Parser::AttributeConstraintError
- WSDL::Parser::ElementConstraintError
- WSDL::Parser::FormatDecodeError
- WSDL::Parser::ParseError
- WSDL::Parser::ParseFrame
- WSDL::Parser::UnexpectedElementError
- WSDL::Parser::UnknownAttributeError
- WSDL::Parser::UnknownElementError
- WSDL::Part
- WSDL::Port
- WSDL::PortType
- WSDL::SOAP
- WSDL::SOAP::Address
- WSDL::SOAP::Binding
- WSDL::SOAP::Body
- WSDL::SOAP::CGIStubCreator
- WSDL::SOAP::ClassDefCreator
- WSDL::SOAP::ClassDefCreatorSupport
- WSDL::SOAP::ClassNameCreator
- WSDL::SOAP::ClientSkeltonCreator
- WSDL::SOAP::DriverCreator
- WSDL::SOAP::EncodedMappingRegistryCreator
- WSDL::SOAP::Fault
- WSDL::SOAP::Header
- WSDL::SOAP::HeaderFault
- WSDL::SOAP::LiteralMappingRegistryCreator
- WSDL::SOAP::MappingRegistryCreator
- WSDL::SOAP::MappingRegistryCreatorSupport
- WSDL::SOAP::MethodDefCreator
- WSDL::SOAP::Operation
- WSDL::SOAP::Operation::ParamInfo
- WSDL::SOAP::ServantSkeltonCreator
- WSDL::SOAP::ServletStubCreator
- WSDL::SOAP::StandaloneServerStubCreator
- WSDL::SOAP::WSDL2Ruby
- WSDL::Service
- WSDL::Types
- WSDL::XMLSchema
- WSDL::XMLSchema::All
- WSDL::XMLSchema::Annotation
- WSDL::XMLSchema::Any
- WSDL::XMLSchema::AnyAttribute
- WSDL::XMLSchema::Attribute
- WSDL::XMLSchema::AttributeGroup
- WSDL::XMLSchema::Choice
- WSDL::XMLSchema::ComplexContent
- WSDL::XMLSchema::ComplexExtension
- WSDL::XMLSchema::ComplexRestriction
- WSDL::XMLSchema::ComplexType
- WSDL::XMLSchema::Content
- WSDL::XMLSchema::Element
- WSDL::XMLSchema::Enumeration
- WSDL::XMLSchema::FractionDigits
- WSDL::XMLSchema::Group
- WSDL::XMLSchema::Import
- WSDL::XMLSchema::ImportHandler
- WSDL::XMLSchema::Importer
- WSDL::XMLSchema::Include
- WSDL::XMLSchema::Length
- WSDL::XMLSchema::List
- WSDL::XMLSchema::MaxExclusive
- WSDL::XMLSchema::MaxInclusive
- WSDL::XMLSchema::MaxLength
- WSDL::XMLSchema::MinExclusive
- WSDL::XMLSchema::MinInclusive
- WSDL::XMLSchema::MinLength
- WSDL::XMLSchema::Parser
- WSDL::XMLSchema::Parser::AttributeConstraintError
- WSDL::XMLSchema::Parser::ElementConstraintError
- WSDL::XMLSchema::Parser::FormatDecodeError
- WSDL::XMLSchema::Parser::ParseError
- WSDL::XMLSchema::Parser::ParseFrame
- WSDL::XMLSchema::Parser::UnexpectedElementError
- WSDL::XMLSchema::Parser::UnknownAttributeError
- WSDL::XMLSchema::Parser::UnknownElementError
- WSDL::XMLSchema::Pattern
- WSDL::XMLSchema::Ref
- WSDL::XMLSchema::Ref::RefClassSupport
- WSDL::XMLSchema::Schema
- WSDL::XMLSchema::Sequence
- WSDL::XMLSchema::SimpleContent
- WSDL::XMLSchema::SimpleExtension
- WSDL::XMLSchema::SimpleRestriction
- WSDL::XMLSchema::SimpleType
- WSDL::XMLSchema::TotalDigits
- WSDL::XMLSchema::Union
- WSDL::XMLSchema::Unique
- WSDL::XMLSchema::WhiteSpace
- WSDL::XMLSchema::XSD2Ruby
- XSD
- XSD::Charset
- XSD::Charset::CharsetConversionError
- XSD::Charset::CharsetError
- XSD::Charset::UnknownCharsetError
- XSD::Charset::XSDError
- XSD::CodeGen
- XSD::CodeGen::ClassDef
- XSD::CodeGen::CommentDef
- XSD::CodeGen::GenSupport
- XSD::CodeGen::MethodDef
- XSD::CodeGen::ModuleDef
- XSD::Error
- XSD::FloatConstants
- XSD::IconvCharset
- XSD::Mapping
- XSD::Mapping::Mapper
- XSD::NS
- XSD::NS::Assigner
- XSD::NS::FormatError
- XSD::NSDBase
- XSD::NamedElements
- XSD::QName
- XSD::ValueSpaceError
- XSD::XMLParser
- XSD::XMLParser::LibXMLParser
- XSD::XMLParser::Parser
- XSD::XMLParser::Parser::ElementConstraintError
- XSD::XMLParser::Parser::FormatDecodeError
- XSD::XMLParser::Parser::ParseError
- XSD::XMLParser::Parser::ParserError
- XSD::XMLParser::Parser::UnexpectedElementError
- XSD::XMLParser::Parser::UnknownAttributeError
- XSD::XMLParser::Parser::UnknownElementError
- XSD::XMLParser::REXMLParser
- XSD::XMLParser::XMLParser
- XSD::XMLParser::XMLParser::Listener
- XSD::XMLParser::XMLScanner
- XSD::XSDAnySimpleType
- XSD::XSDAnyURI
- XSD::XSDBase64Binary
- XSD::XSDBoolean
- XSD::XSDByte
- XSD::XSDDate
- XSD::XSDDateTime
- XSD::XSDDateTimeImpl
- XSD::XSDDecimal
- XSD::XSDDouble
- XSD::XSDDuration
- XSD::XSDENTITIES
- XSD::XSDENTITY
- XSD::XSDFloat
- XSD::XSDGDay
- XSD::XSDGMonth
- XSD::XSDGMonthDay
- XSD::XSDGYear
- XSD::XSDGYearMonth
- XSD::XSDHexBinary
- XSD::XSDID
- XSD::XSDIDREF
- XSD::XSDIDREFS
- XSD::XSDInt
- XSD::XSDInteger
- XSD::XSDLanguage
- XSD::XSDLong
- XSD::XSDNCName
- XSD::XSDNMTOKEN
- XSD::XSDNMTOKENS
- XSD::XSDName
- XSD::XSDNegativeInteger
- XSD::XSDNil
- XSD::XSDNonNegativeInteger
- XSD::XSDNonPositiveInteger
- XSD::XSDNormalizedString
- XSD::XSDPositiveInteger
- XSD::XSDQName
- XSD::XSDShort
- XSD::XSDString
- XSD::XSDTime
- XSD::XSDToken
- XSD::XSDUnsignedByte
- XSD::XSDUnsignedInt
- XSD::XSDUnsignedLong
- XSD::XSDUnsignedShort
- Object
- Object::SOAPMarshal
- WEBrick
- WEBrick::Log
- Enumerable
- Hash
- Kernel

No matching classes.

# WSDL::XMLSchema::ComplexType

### Attributes

abstract[RW]
complexcontent[RW]
content[R]
final[RW]
mixed[RW]
name[RW]
simplecontent[RW]

### Public Class Methods

new(name = nil) click to toggle source

    # File lib/wsdl/xmlSchema/complexType.rb, line 27
    def initialize(name = nil)
      super()
      @name = name
      @complexcontent = nil
      @simplecontent = nil
      @content = nil
      @final = nil
      @mixed = false
      @abstract = false
      @attributes = XSD::NamedElements.new
    end

### Public Instance Methods

all_elements=(elements) click to toggle source

    # File lib/wsdl/xmlSchema/complexType.rb, line 137
    def all_elements=(elements)
      @content = All.new
      elements.each do |element|
        @content << element
      end
    end

attributes() click to toggle source

    # File lib/wsdl/xmlSchema/complexType.rb, line 79
    def attributes
      attrs = nil
      if @complexcontent
        attrs = @complexcontent.attributes + @attributes
      elsif @simplecontent
        attrs = @simplecontent.attributes + @attributes
      else
        attrs = @attributes
      end
      found = XSD::NamedElements.new
      attrs.each do |attr|
        case attr
        when Attribute
          found << attr
        when AttributeGroup
          if attr.attributes
            found.concat(attr.attributes)
          end
        when AnyAttribute
          # ignored
        else
          warn("unknown attribute: #{attr}")
        end
      end
      found
    end

base() click to toggle source

    # File lib/wsdl/xmlSchema/complexType.rb, line 65
    def base
      if c = @complexcontent || @simplecontent
        c.base
      end
    end

check_type() click to toggle source

    # File lib/wsdl/soap/complexType.rb, line 22
    def check_type
      if have_any?
        :TYPE_STRUCT
      elsif content
        if attributes.empty? and map_as_array?
          if name == ::SOAP::Mapping::MapQName
            :TYPE_MAP
          else
            :TYPE_ARRAY
          end
        else
          :TYPE_STRUCT
        end
      elsif complexcontent
        complexcontent.check_type
      elsif simplecontent
        :TYPE_SIMPLE
      elsif !attributes.empty?
        :TYPE_STRUCT
      else # empty complexType definition (seen in partner.wsdl of salesforce)
        :TYPE_EMPTY
      end
    end

child_defined_complextype(name) click to toggle source

    # File lib/wsdl/soap/complexType.rb, line 71
    def child_defined_complextype(name)
      ele = nil
      case compoundtype
      when :TYPE_STRUCT, :TYPE_MAP
        unless ele = find_element(name)
          if name.namespace.nil?
            ele = find_element_by_name(name.name)
          end
        end
      when :TYPE_ARRAY
        e = elements
        if e.size == 1
          ele = e[0]
        else
          raise RuntimeError.new("Assert: must not reach.")
        end
      else
        raise RuntimeError.new("Assert: Not implemented.")
      end
      unless ele
        raise RuntimeError.new("Cannot find #{name} as a children of #{@name}.")
      end
      ele.local_complextype
    end

child_type(name = nil) click to toggle source

    # File lib/wsdl/soap/complexType.rb, line 46
    def child_type(name = nil)
      case compoundtype
      when :TYPE_STRUCT
        if ele = find_element(name)
          ele.type
        elsif ele = find_element_by_name(name.name)
          ele.type
        end
      when :TYPE_ARRAY
        @contenttype ||= content_arytype
      when :TYPE_MAP
        item_ele = find_element_by_name("item") or
          raise RuntimeError.new("'item' element not found in Map definition.")
        content = item_ele.local_complextype or
          raise RuntimeError.new("No complexType definition for 'item'.")
        if ele = content.find_element(name)
          ele.type
        elsif ele = content.find_element_by_name(name.name)
          ele.type
        end
      else
        raise NotImplementedError.new("Unknown kind of complexType.")
      end
    end

choice?() click to toggle source

    # File lib/wsdl/xmlSchema/complexType.rb, line 57
    def choice?
      if c = @complexcontent || @content
        c.choice?
      else
        false
      end
    end

compoundtype() click to toggle source

    # File lib/wsdl/soap/complexType.rb, line 18
    def compoundtype
      @compoundtype ||= check_type
    end

elementformdefault() click to toggle source

    # File lib/wsdl/xmlSchema/complexType.rb, line 45
    def elementformdefault
      parent.elementformdefault
    end

elements() click to toggle source

    # File lib/wsdl/xmlSchema/complexType.rb, line 71
    def elements
      if c = @complexcontent || @content
        c.elements
      else
        XSD::NamedElements::Empty
      end
    end

find_aryelement() click to toggle source

    # File lib/wsdl/soap/complexType.rb, line 125
    def find_aryelement
      unless compoundtype == :TYPE_ARRAY
        raise RuntimeError.new("Assert: not for array")
      end
      if map_as_array?
        return nested_elements[0]
      end
      nil # use default item name
    end

find_arytype() click to toggle source

    # File lib/wsdl/soap/complexType.rb, line 112
    def find_arytype
      unless compoundtype == :TYPE_ARRAY
        raise RuntimeError.new("Assert: not for array")
      end
      if arytype = find_soapenc_arytype
        return arytype
      end
      if map_as_array?
        return element_simpletype(elements[0])
      end
      raise RuntimeError.new("Assert: Unknown array definition.")
    end

find_element(name) click to toggle source

    # File lib/wsdl/xmlSchema/complexType.rb, line 114
    def find_element(name)
      return nil if name.nil?
      elements.each do |element|
        return element if name == element.name
      end
      nil
    end

find_element_by_name(name) click to toggle source

    # File lib/wsdl/xmlSchema/complexType.rb, line 122
    def find_element_by_name(name)
      return nil if name.nil?
      elements.each do |element|
        return element if name == element.name.name
      end
      nil
    end

find_soapenc_arytype() click to toggle source

    # File lib/wsdl/soap/complexType.rb, line 96
    def find_soapenc_arytype
      unless compoundtype == :TYPE_ARRAY
        raise RuntimeError.new("Assert: not for array")
      end
      if complexcontent
        if complexcontent.restriction
          complexcontent.restriction.attributes.each do |attribute|
            if attribute.ref == ::SOAP::AttrArrayTypeName
              return attribute.arytype
            end
          end
        end
      end
      nil
    end

have_any?() click to toggle source

    # File lib/wsdl/xmlSchema/complexType.rb, line 49
    def have_any?
      if c = @complexcontent || @content
        c.have_any?
      else
        false
      end
    end

nested_elements() click to toggle source

    # File lib/wsdl/xmlSchema/complexType.rb, line 106
    def nested_elements
      if c = @complexcontent || @content
        c.nested_elements
      else
        XSD::NamedElements::Empty
      end
    end

parse_attr(attr, value) click to toggle source

    # File lib/wsdl/xmlSchema/complexType.rb, line 175
    def parse_attr(attr, value)
      case attr
      when AbstractAttrName
        @abstract = to_boolean(value)
      when FinalAttrName
        @final = value.source
      when MixedAttrName
        @mixed = to_boolean(value)
      when NameAttrName
        @name = XSD::QName.new(targetnamespace, value.source)
      else
        nil
      end
    end

parse_element(element) click to toggle source

    # File lib/wsdl/xmlSchema/complexType.rb, line 144
    def parse_element(element)
      case element
      when AllName
        @content = All.new
      when SequenceName
        @content = Sequence.new
      when ChoiceName
        @content = Choice.new
      when GroupName
        @content = Group.new
      when ComplexContentName
        @complexcontent = ComplexContent.new
      when SimpleContentName
        @simplecontent = SimpleContent.new
      when AttributeName
        o = Attribute.new
        @attributes << o
        o
      when AttributeGroupName
        o = AttributeGroup.new
        @attributes << o
        o
      when AnyAttributeName
        o = AnyAttribute.new
        @attributes << o
        o
      else
        nil
      end
    end

sequence_elements=(elements) click to toggle source

    # File lib/wsdl/xmlSchema/complexType.rb, line 130
    def sequence_elements=(elements)
      @content = Sequence.new
      elements.each do |element|
        @content << element
      end
    end

targetnamespace() click to toggle source

    # File lib/wsdl/xmlSchema/complexType.rb, line 39
    def targetnamespace
      # inner elements can be qualified
      # parent.is_a?(WSDL::XMLSchema::Element) ? nil : parent.targetnamespace
      parent.targetnamespace
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.