Class: SOAP::WSDL::Service
- Inherits:
-
Object
- Object
- SOAP::WSDL::Service
- Defined in:
- lib/wsdl-reader/service.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#ports ⇒ Object
readonly
Returns the value of attribute ports.
Instance Method Summary collapse
-
#initialize(element) ⇒ Service
constructor
A new instance of Service.
Constructor Details
#initialize(element) ⇒ Service
Returns a new instance of Service.
18 19 20 21 22 23 24 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 51 52 53 |
# File 'lib/wsdl-reader/service.rb', line 18 def initialize( element ) @ports = Hash.new @name = element.attributes['name'] # Process all ports element.find_all {|e| e.class == REXML::Element }.each { |port| case port.name when "port" @ports[port.attributes['name']] = Hash.new # Store port attributs port.attributes.each { |name, value| case name when 'name' @ports[port.attributes['name']][:name] = value when 'binding' @ports[port.attributes['name']][:binding] = value else warn "Ignoring attribut `#{name}' in port `#{port.attributes['name']}' for service `#{element.attributes['name']}'" end } # Store port soap:address port.find_all {|e| e.class == REXML::Element }.each { |address| case address.name when "address" @ports[port.attributes['name']][:address] = address.attributes['location'] else warn "Ignoring element `#{address.name}' in port `#{port.attributes['name']}' for service `#{element.attributes['name']}'" end } else warn "Ignoring element `#{port.name}' in service `#{element.attributes['name']}'" end } end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
16 17 18 |
# File 'lib/wsdl-reader/service.rb', line 16 def name @name end |
#ports ⇒ Object (readonly)
Returns the value of attribute ports.
15 16 17 |
# File 'lib/wsdl-reader/service.rb', line 15 def ports @ports end |