Class: WsdlMapper::SvcDescParsing::ServiceParser

Inherits:
ParserBase show all
Defined in:
lib/wsdl_mapper/svc_desc_parsing/service_parser.rb

Constant Summary

Constant Summary

Constants inherited from ParserBase

ParserBase::Soap, ParserBase::SoapEnc, ParserBase::SoapHttp

Constants included from Wsdl11

Wsdl11::ARRAY_TYPE, Wsdl11::BINDING, Wsdl11::DEFINITIONS, Wsdl11::DOCUMENTATION, Wsdl11::FAULT, Wsdl11::INPUT, Wsdl11::MESSAGE, Wsdl11::NS, Wsdl11::OPERATION, Wsdl11::OUTPUT, Wsdl11::PART, Wsdl11::PORT, Wsdl11::PORT_TYPE, Wsdl11::SERVICE, Wsdl11::TYPES

Constants inherited from Parsing::Base

Parsing::Base::NS_DECL_PREFIX, Parsing::Base::TARGET_NS

Instance Attribute Summary

Attributes included from Parsing::Logging

#log_msgs

Instance Method Summary (collapse)

Methods inherited from Parsing::Base

get_name, #initialize

Methods included from Parsing::Logging

#log_msg

Constructor Details

This class inherits a constructor from WsdlMapper::Parsing::Base

Instance Method Details

- (Object) parse(node)



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/wsdl_mapper/svc_desc_parsing/service_parser.rb', line 7

def parse(node)
  name = parse_name_in_attribute 'name', node

  service = Service.new name

  each_element node do |child|
    parse_service_child child, service
  end

  @base.description.add_service service
end

- (Object) parse_port_address(node, port)



54
55
56
# File 'lib/wsdl_mapper/svc_desc_parsing/service_parser.rb', line 54

def parse_port_address(node, port)
  port.address_location = fetch_attribute_value 'location', node
end

- (Object) parse_port_child(node, port)



43
44
45
46
47
48
49
50
51
52
# File 'lib/wsdl_mapper/svc_desc_parsing/service_parser.rb', line 43

def parse_port_child(node, port)
  case get_name node
  when Soap::ADDRESS
    parse_port_address node, port
  when DOCUMENTATION
    @base.parse_documentation node, port
  else
    log_msg node, :unknown
  end
end

- (Object) parse_service_child(node, service)



19
20
21
22
23
24
25
26
27
28
# File 'lib/wsdl_mapper/svc_desc_parsing/service_parser.rb', line 19

def parse_service_child(node, service)
  case get_name node
  when PORT
    parse_service_port node, service
  when DOCUMENTATION
    @base.parse_documentation node, service
  else
    log_msg node, :unknown
  end
end

- (Object) parse_service_port(node, service)



30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/wsdl_mapper/svc_desc_parsing/service_parser.rb', line 30

def parse_service_port(node, service)
  name = parse_name_in_attribute 'name', node

  port = Service::Port.new name
  port.binding_name = parse_name_in_attribute 'binding', node

  each_element node do |child|
    parse_port_child child, port
  end

  service.add_port port
end