Class: SOAP::WSDL::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/soap/lc/wsdl/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri) ⇒ Parser

Returns a new instance of Parser.



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/soap/lc/wsdl/parser.rb', line 25

def initialize( uri )
  @types = SOAP::XSD.new()
  @messages = SOAP::WSDL::Messages.new
  @portTypes = SOAP::WSDL::PortTypes.new
  @bindings = SOAP::WSDL::Bindings.new
  @services = SOAP::WSDL::Services.new
  
  @prefixes = Hash.new
  @targetNamespace = ""

  # Get WSDL 
  source = nil
  begin
    open( uri ) do |f|
      source = f.read
    end
  rescue Errno::ECONNREFUSED, Errno::ENOENT, OpenURI::HTTPError => e
    raise SOAP::LCError, "Can't open '#{uri}' : #{e.message}"
  end

  # Parse WSDL content
  @document = REXML::Document.new( source )
  
  processAttributes @document.root.attributes
  processContent @document.root.children
end

Instance Attribute Details

#bindingsObject (readonly)

Returns the value of attribute bindings.



17
18
19
# File 'lib/soap/lc/wsdl/parser.rb', line 17

def bindings
  @bindings
end

#documentObject (readonly)

Returns the value of attribute document.



23
24
25
# File 'lib/soap/lc/wsdl/parser.rb', line 23

def document
  @document
end

#messagesObject (readonly)

Returns the value of attribute messages.



15
16
17
# File 'lib/soap/lc/wsdl/parser.rb', line 15

def messages
  @messages
end

#portTypesObject (readonly)

Returns the value of attribute portTypes.



16
17
18
# File 'lib/soap/lc/wsdl/parser.rb', line 16

def portTypes
  @portTypes
end

#prefixesObject (readonly)

Returns the value of attribute prefixes.



20
21
22
# File 'lib/soap/lc/wsdl/parser.rb', line 20

def prefixes
  @prefixes
end

#servicesObject (readonly)

Returns the value of attribute services.



18
19
20
# File 'lib/soap/lc/wsdl/parser.rb', line 18

def services
  @services
end

#targetNamespaceObject (readonly)

Returns the value of attribute targetNamespace.



21
22
23
# File 'lib/soap/lc/wsdl/parser.rb', line 21

def targetNamespace
  @targetNamespace
end

#typesObject (readonly)

Returns the value of attribute types.



14
15
16
# File 'lib/soap/lc/wsdl/parser.rb', line 14

def types
  @types
end