Class: WsdlMapper::SvcDescParsing::ServiceParser
- Inherits:
-
ParserBase
show all
- Defined in:
- lib/wsdl_mapper/svc_desc_parsing/service_parser.rb
Constant Summary
Constants inherited
from ParserBase
ParserBase::Http, ParserBase::Soap, ParserBase::Soap12, 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
Parsing::Base::NS_DECL_PREFIX, Parsing::Base::TARGET_NS
Instance Attribute Summary
#log_msgs
Instance Method Summary
collapse
get_name, #initialize
#log_msg
Instance Method Details
#parse(node) ⇒ Object
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
|
#parse_port_address(node, port) ⇒ Object
61
62
63
|
# File 'lib/wsdl_mapper/svc_desc_parsing/service_parser.rb', line 61
def parse_port_address(node, port)
port.address_location = fetch_attribute_value 'location', node
end
|
#parse_port_child(node, port) ⇒ Object
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# File 'lib/wsdl_mapper/svc_desc_parsing/service_parser.rb', line 44
def parse_port_child(node, port)
case get_name node
when Soap::ADDRESS
parse_port_address node, port
when Soap12::ADDRESS
log_msg node, :unsupported
return false
when Http::ADDRESS
log_msg node, :unsupported
return false
when DOCUMENTATION
@base.parse_documentation node, port
else
log_msg node, :unknown
end
end
|
#parse_service_child(node, service) ⇒ Object
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
|
#parse_service_port(node, service) ⇒ Object
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# 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
success = true
each_element node do |child|
success = parse_port_child(child, port) && success
end
service.add_port(port) if success
end
|