Sha256: 31b718a4761b4b004d0b576a8a0726f50741dac8783fb18b6fd0e4ad6062b8a2

Contents?: true

Size: 989 Bytes

Versions: 20

Compression:

Stored size: 989 Bytes

Contents

require 'wasabi'
require 'savon'

# document = Savon.client(wsdl: 'test.wsdl').wsdl
# document = Savon.client(wsdl: 'http://www.webservicex.com/globalweather.asmx?wsdl').wsdl
# document = Wasabi.document File.read('test.wsdl')
document = Wasabi.document 'http://www.webservicex.net/ConvertTemperature.asmx?WSDL'
parser = document.parser

# TEST SCHEMA
#
# parser.schemas.each do |schema|
#   puts 'SCHEMA * '
#   puts schema
#
#   xsd = Nokogiri::XML::Schema(schema.to_s)
#
#   doc = Nokogiri::XML(File.read('test.xml'))
#
#   xsd.validate(doc).each do |error|
#     puts error.message
#   end
# end
#

schemes = parser.schemas
puts schemes
custom_type = schemes.xpath("//*[@name='TemperatureUnit']")
if custom_type.first
  puts 'CUST' + custom_type.to_s
  prefix = custom_type.first.namespace.prefix
  puts prefix

  enumerations = custom_type.xpath("//#{prefix}:enumeration")

  puts 'ENUM' + enumerations.to_s

  enumerations.each do |enum_value|
    puts enum_value['value']
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
soaspec-0.2.29 test_wsdl.rb
soaspec-0.2.28 test_wsdl.rb
soaspec-0.2.27 test_wsdl.rb
soaspec-0.2.26 test_wsdl.rb
soaspec-0.2.25 test_wsdl.rb
soaspec-0.2.23 test_wsdl.rb
soaspec-0.2.22 test_wsdl.rb
soaspec-0.2.21 test_wsdl.rb
soaspec-0.2.20 test_wsdl.rb
soaspec-0.2.19 test_wsdl.rb
soaspec-0.2.18 test_wsdl.rb
soaspec-0.2.17 test_wsdl.rb
soaspec-0.2.16 test_wsdl.rb
soaspec-0.2.15 test_wsdl.rb
soaspec-0.2.14 test_wsdl.rb
soaspec-0.2.13 test_wsdl.rb
soaspec-0.2.12 test_wsdl.rb
soaspec-0.2.11 test_wsdl.rb
soaspec-0.2.10 test_wsdl.rb
soaspec-0.2.9 test_wsdl.rb