soaspec 0.2.32 → 0.2.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +15 -15
- data/.gitlab-ci.yml +62 -62
- data/.rspec +3 -3
- data/.rubocop.yml +2 -2
- data/CODE_OF_CONDUCT.md +74 -74
- data/ChangeLog +632 -625
- data/Dockerfile +7 -7
- data/Gemfile +8 -8
- data/LICENSE.txt +21 -21
- data/README.md +231 -231
- data/Rakefile +52 -52
- data/Todo.md +16 -16
- data/exe/soaspec +138 -138
- data/exe/xml_to_yaml_file +43 -43
- data/lib/soaspec.rb +106 -105
- data/lib/soaspec/baseline.rb +23 -0
- data/lib/soaspec/core_ext/hash.rb +44 -44
- data/lib/soaspec/cucumber/generic_steps.rb +94 -94
- data/lib/soaspec/demo.rb +6 -6
- data/lib/soaspec/errors.rb +24 -22
- data/lib/soaspec/exchange/exchange.rb +129 -129
- data/lib/soaspec/exchange/exchange_extractor.rb +90 -90
- data/lib/soaspec/exchange/exchange_properties.rb +28 -28
- data/lib/soaspec/exchange/exchange_repeater.rb +21 -21
- data/lib/soaspec/exchange/request_builder.rb +70 -70
- data/lib/soaspec/exchange/variable_storer.rb +24 -24
- data/lib/soaspec/exchange_handlers/exchange_handler.rb +98 -98
- data/lib/soaspec/exchange_handlers/exchange_handler_defaults.rb +61 -61
- data/lib/soaspec/exchange_handlers/handler_accessors.rb +132 -132
- data/lib/soaspec/exchange_handlers/request/rest_request.rb +59 -51
- data/lib/soaspec/exchange_handlers/request/soap_request.rb +41 -41
- data/lib/soaspec/exchange_handlers/response_extractor.rb +84 -84
- data/lib/soaspec/exchange_handlers/rest_exchanger_factory.rb +111 -111
- data/lib/soaspec/exchange_handlers/rest_handler.rb +307 -298
- data/lib/soaspec/exchange_handlers/rest_methods.rb +65 -65
- data/lib/soaspec/exchange_handlers/rest_parameters.rb +112 -112
- data/lib/soaspec/exchange_handlers/rest_parameters_defaults.rb +42 -42
- data/lib/soaspec/exchange_handlers/soap_handler.rb +241 -241
- data/lib/soaspec/exe_helpers.rb +94 -94
- data/lib/soaspec/generate_server.rb +48 -48
- data/lib/soaspec/generator/.rspec.erb +5 -5
- data/lib/soaspec/generator/.travis.yml.erb +5 -5
- data/lib/soaspec/generator/Gemfile.erb +8 -8
- data/lib/soaspec/generator/README.md.erb +29 -29
- data/lib/soaspec/generator/Rakefile.erb +19 -19
- data/lib/soaspec/generator/config/data/default.yml.erb +2 -2
- data/lib/soaspec/generator/css/bootstrap.css +6833 -6833
- data/lib/soaspec/generator/features/support/env.rb.erb +3 -3
- data/lib/soaspec/generator/generate_exchange.html.erb +47 -47
- data/lib/soaspec/generator/lib/blz_service.rb.erb +26 -26
- data/lib/soaspec/generator/lib/dynamic_class_content.rb.erb +12 -12
- data/lib/soaspec/generator/lib/new_rest_service.rb.erb +56 -56
- data/lib/soaspec/generator/lib/new_soap_service.rb.erb +29 -29
- data/lib/soaspec/generator/lib/package_service.rb.erb +2 -2
- data/lib/soaspec/generator/lib/shared_example.rb.erb +8 -8
- data/lib/soaspec/generator/spec/dynamic_soap_spec.rb.erb +12 -12
- data/lib/soaspec/generator/spec/rest_spec.rb.erb +9 -9
- data/lib/soaspec/generator/spec/soap_spec.rb.erb +51 -51
- data/lib/soaspec/generator/spec/spec_helper.rb.erb +23 -23
- data/lib/soaspec/generator/template/soap_template.xml +6 -6
- data/lib/soaspec/indifferent_hash.rb +9 -9
- data/lib/soaspec/interpreter.rb +70 -70
- data/lib/soaspec/matchers.rb +140 -118
- data/lib/soaspec/o_auth2.rb +142 -142
- data/lib/soaspec/soaspec_shared_examples.rb +26 -26
- data/lib/soaspec/spec_logger.rb +143 -143
- data/lib/soaspec/template_reader.rb +30 -30
- data/lib/soaspec/test_server/bank.wsdl +90 -90
- data/lib/soaspec/test_server/get_bank.rb +166 -166
- data/lib/soaspec/test_server/id_manager.rb +41 -41
- data/lib/soaspec/test_server/invoices.rb +29 -29
- data/lib/soaspec/test_server/namespace.xml +14 -14
- data/lib/soaspec/test_server/note.xml +5 -5
- data/lib/soaspec/test_server/puppy_service.rb +21 -21
- data/lib/soaspec/test_server/test_attribute.rb +14 -14
- data/lib/soaspec/test_server/test_namespace.rb +14 -14
- data/lib/soaspec/version.rb +6 -6
- data/lib/soaspec/virtual_server.rb +190 -176
- data/lib/soaspec/wait.rb +43 -43
- data/lib/soaspec/wsdl_generator.rb +215 -215
- data/soaspec.gemspec +58 -58
- data/test.wsdl +116 -116
- data/test.xml +10 -10
- data/test_wsdl.rb +43 -43
- metadata +4 -3
data/soaspec.gemspec
CHANGED
@@ -1,58 +1,58 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
lib = File.expand_path('lib', __dir__)
|
4
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
require 'soaspec/version'
|
6
|
-
|
7
|
-
Gem::Specification.new do |spec|
|
8
|
-
spec.name = 'soaspec'
|
9
|
-
spec.version = Soaspec::VERSION
|
10
|
-
spec.authors = ['SamuelGarrattIQA']
|
11
|
-
spec.email = ['samuel.garratt@integrationqa.com']
|
12
|
-
|
13
|
-
spec.summary = "Helps to create tests for 'SOAP' or 'REST' apis "
|
14
|
-
spec.description = "Helps to create tests for 'SOAP' or 'REST' apis. Easily represent multiple requests with
|
15
|
-
the same configuration. Examples designed for RSpec and Cucumber."
|
16
|
-
spec.homepage = 'https://gitlab.com/samuel-garratt/soaspec'
|
17
|
-
spec.license = 'MIT'
|
18
|
-
|
19
|
-
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
20
|
-
f.match(%r{^(test|spec|features|bin|config|templates|credentials|images|demo|support)/})
|
21
|
-
end
|
22
|
-
spec.bindir = 'exe'
|
23
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
|
-
spec.require_paths = ['lib']
|
25
|
-
spec.required_ruby_version = '>= 2.3.0'
|
26
|
-
|
27
|
-
spec.add_development_dependency 'bundler'
|
28
|
-
spec.add_development_dependency 'cucumber'
|
29
|
-
spec.add_development_dependency 'data_magic'
|
30
|
-
spec.add_development_dependency 'factory_bot'
|
31
|
-
spec.add_development_dependency 'parallel_tests'
|
32
|
-
spec.add_development_dependency 'rack'
|
33
|
-
spec.add_development_dependency 'rack-test'
|
34
|
-
spec.add_development_dependency 'rake', '~> 12.0'
|
35
|
-
spec.add_development_dependency 'rspec', '~> 3.0'
|
36
|
-
spec.add_development_dependency 'simplecov'
|
37
|
-
spec.add_development_dependency 'yard-cucumber'
|
38
|
-
spec.add_development_dependency 'yard-doctest'
|
39
|
-
spec.add_dependency 'activesupport'
|
40
|
-
spec.add_dependency 'colorize'
|
41
|
-
spec.add_dependency 'faker'
|
42
|
-
spec.add_dependency 'hashie'
|
43
|
-
spec.add_dependency 'jsonpath'
|
44
|
-
spec.add_dependency 'launchy'
|
45
|
-
spec.add_dependency 'nokogiri'
|
46
|
-
spec.add_dependency 'pry'
|
47
|
-
spec.add_dependency 'random-port'
|
48
|
-
spec.add_dependency 'require_all', '>= 1.5.0'
|
49
|
-
spec.add_dependency 'rest-client', '>= 2.0' # REST
|
50
|
-
spec.add_dependency 'rspec', '~> 3.0' # This framework is designed to work with RSpec
|
51
|
-
spec.add_dependency 'rspec-its'
|
52
|
-
spec.add_dependency 'savon', '>= 2' # SOAP
|
53
|
-
spec.add_dependency 'sinatra', '2.0.4'
|
54
|
-
spec.add_dependency 'sinatra-basic-auth'
|
55
|
-
spec.add_dependency 'sinatra-docdsl'
|
56
|
-
spec.add_dependency 'thor'
|
57
|
-
spec.add_dependency 'xml-simple', '>= 1.1.5'
|
58
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'soaspec/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = 'soaspec'
|
9
|
+
spec.version = Soaspec::VERSION
|
10
|
+
spec.authors = ['SamuelGarrattIQA']
|
11
|
+
spec.email = ['samuel.garratt@integrationqa.com']
|
12
|
+
|
13
|
+
spec.summary = "Helps to create tests for 'SOAP' or 'REST' apis "
|
14
|
+
spec.description = "Helps to create tests for 'SOAP' or 'REST' apis. Easily represent multiple requests with
|
15
|
+
the same configuration. Examples designed for RSpec and Cucumber."
|
16
|
+
spec.homepage = 'https://gitlab.com/samuel-garratt/soaspec'
|
17
|
+
spec.license = 'MIT'
|
18
|
+
|
19
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
20
|
+
f.match(%r{^(test|spec|features|bin|config|templates|credentials|images|demo|support)/})
|
21
|
+
end
|
22
|
+
spec.bindir = 'exe'
|
23
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
|
+
spec.require_paths = ['lib']
|
25
|
+
spec.required_ruby_version = '>= 2.3.0'
|
26
|
+
|
27
|
+
spec.add_development_dependency 'bundler'
|
28
|
+
spec.add_development_dependency 'cucumber'
|
29
|
+
spec.add_development_dependency 'data_magic'
|
30
|
+
spec.add_development_dependency 'factory_bot'
|
31
|
+
spec.add_development_dependency 'parallel_tests'
|
32
|
+
spec.add_development_dependency 'rack'
|
33
|
+
spec.add_development_dependency 'rack-test'
|
34
|
+
spec.add_development_dependency 'rake', '~> 12.0'
|
35
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
36
|
+
spec.add_development_dependency 'simplecov'
|
37
|
+
spec.add_development_dependency 'yard-cucumber'
|
38
|
+
spec.add_development_dependency 'yard-doctest'
|
39
|
+
spec.add_dependency 'activesupport'
|
40
|
+
spec.add_dependency 'colorize'
|
41
|
+
spec.add_dependency 'faker'
|
42
|
+
spec.add_dependency 'hashie'
|
43
|
+
spec.add_dependency 'jsonpath'
|
44
|
+
spec.add_dependency 'launchy'
|
45
|
+
spec.add_dependency 'nokogiri'
|
46
|
+
spec.add_dependency 'pry'
|
47
|
+
spec.add_dependency 'random-port'
|
48
|
+
spec.add_dependency 'require_all', '>= 1.5.0'
|
49
|
+
spec.add_dependency 'rest-client', '>= 2.0' # REST
|
50
|
+
spec.add_dependency 'rspec', '~> 3.0' # This framework is designed to work with RSpec
|
51
|
+
spec.add_dependency 'rspec-its'
|
52
|
+
spec.add_dependency 'savon', '>= 2' # SOAP
|
53
|
+
spec.add_dependency 'sinatra', '2.0.4'
|
54
|
+
spec.add_dependency 'sinatra-basic-auth'
|
55
|
+
spec.add_dependency 'sinatra-docdsl'
|
56
|
+
spec.add_dependency 'thor'
|
57
|
+
spec.add_dependency 'xml-simple', '>= 1.1.5'
|
58
|
+
end
|
data/test.wsdl
CHANGED
@@ -1,116 +1,116 @@
|
|
1
|
-
<wsdl:definitions
|
2
|
-
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
3
|
-
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
|
4
|
-
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
|
5
|
-
xmlns:tns="http://Example.org"
|
6
|
-
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
|
7
|
-
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
|
8
|
-
xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy"
|
9
|
-
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
10
|
-
xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract"
|
11
|
-
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
|
12
|
-
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
|
13
|
-
xmlns:wsa10="http://www.w3.org/2005/08/addressing"
|
14
|
-
xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" targetNamespace="http://Example.org"
|
15
|
-
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
|
16
|
-
<wsdl:types>
|
17
|
-
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
18
|
-
targetNamespace="https://www.w3schools.com"
|
19
|
-
xmlns="https://www.w3schools.com"
|
20
|
-
elementFormDefault="qualified">
|
21
|
-
|
22
|
-
<xs:element name="note">
|
23
|
-
<xs:complexType>
|
24
|
-
<xs:sequence>
|
25
|
-
<xs:element name="to" type="xs:string"/>
|
26
|
-
<xs:element name="from" type="xs:string"/>
|
27
|
-
<xs:element name="heading" type="xs:string"/>
|
28
|
-
<xs:element name="body" type="xs:string"/>
|
29
|
-
</xs:sequence>
|
30
|
-
</xs:complexType>
|
31
|
-
</xs:element>
|
32
|
-
|
33
|
-
</xs:schema>
|
34
|
-
<s:schema xmlns:s="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.webserviceX.NET">
|
35
|
-
<s:element name="GetWeather">
|
36
|
-
<s:complexType>
|
37
|
-
<s:sequence>
|
38
|
-
<s:element minOccurs="0" maxOccurs="1" name="CityName" type="s:string"/>
|
39
|
-
<s:element minOccurs="0" maxOccurs="1" name="CountryName" type="s:string"/>
|
40
|
-
</s:sequence>
|
41
|
-
</s:complexType>
|
42
|
-
</s:element>
|
43
|
-
<s:element name="GetWeatherResponse">
|
44
|
-
<s:complexType>
|
45
|
-
<s:sequence>
|
46
|
-
<s:element minOccurs="0" maxOccurs="1" name="GetWeatherResult" type="s:string"/>
|
47
|
-
</s:sequence>
|
48
|
-
</s:complexType>
|
49
|
-
</s:element>
|
50
|
-
<s:element name="GetCitiesByCountry">
|
51
|
-
<s:complexType>
|
52
|
-
<s:sequence>
|
53
|
-
<s:element minOccurs="0" maxOccurs="1" name="CountryName" type="s:string"/>
|
54
|
-
</s:sequence>
|
55
|
-
</s:complexType>
|
56
|
-
</s:element>
|
57
|
-
<s:element name="GetCitiesByCountryResponse">
|
58
|
-
<s:complexType>
|
59
|
-
<s:sequence>
|
60
|
-
<s:element minOccurs="0" maxOccurs="1" name="GetCitiesByCountryResult" type="s:string"/>
|
61
|
-
</s:sequence>
|
62
|
-
</s:complexType>
|
63
|
-
</s:element>
|
64
|
-
<s:element name="string" nillable="true" type="s:string"/>
|
65
|
-
</s:schema>
|
66
|
-
|
67
|
-
</wsdl:types>
|
68
|
-
<wsdl:message name="ICalculator_Add_InputMessage">
|
69
|
-
<wsdl:part name="parameters" element="tns:Add" />
|
70
|
-
</wsdl:message>
|
71
|
-
<wsdl:message name="ICalculator_Add_OutputMessage">
|
72
|
-
<wsdl:part name="parameters" element="tns:AddResponse" />
|
73
|
-
</wsdl:message>
|
74
|
-
<wsdl:message name="ICalculator_Subtract_InputMessage">
|
75
|
-
<wsdl:part name="parameters" element="tns:Subtract" />
|
76
|
-
</wsdl:message>
|
77
|
-
<wsdl:message name="ICalculator_Subtract_OutputMessage">
|
78
|
-
<wsdl:part name="parameters" element="tns:SubtractResponse" />
|
79
|
-
</wsdl:message>
|
80
|
-
<wsdl:portType name="ICalculator">
|
81
|
-
<wsdl:operation name="Add">
|
82
|
-
<wsdl:input wsaw:Action="http://Example.org/ICalculator/Add" message="tns:ICalculator_Add_InputMessage" />
|
83
|
-
<wsdl:output wsaw:Action="http://Example.org/ICalculator/AddResponse" message="tns:ICalculator_Add_OutputMessage" />
|
84
|
-
</wsdl:operation>
|
85
|
-
<wsdl:operation name="Subtract">
|
86
|
-
<wsdl:input wsaw:Action="http://Example.org/ICalculator/Subtract" message="tns:ICalculator_Subtract_InputMessage" />
|
87
|
-
<wsdl:output wsaw:Action="http://Example.org/ICalculator/SubtractResponse" message="tns:ICalculator_Subtract_OutputMessage" />
|
88
|
-
</wsdl:operation>
|
89
|
-
</wsdl:portType>
|
90
|
-
<wsdl:binding name="DefaultBinding_ICalculator" type="tns:ICalculator">
|
91
|
-
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
|
92
|
-
<wsdl:operation name="Add">
|
93
|
-
<soap:operation soapAction="http://Example.org/ICalculator/Add" style="document" />
|
94
|
-
<wsdl:input>
|
95
|
-
<soap:body use="literal" />
|
96
|
-
</wsdl:input>
|
97
|
-
<wsdl:output>
|
98
|
-
<soap:body use="literal" />
|
99
|
-
</wsdl:output>
|
100
|
-
</wsdl:operation>
|
101
|
-
<wsdl:operation name="Subtract">
|
102
|
-
<soap:operation soapAction="http://Example.org/ICalculator/Subtract" style="document" />
|
103
|
-
<wsdl:input>
|
104
|
-
<soap:body use="literal" />
|
105
|
-
</wsdl:input>
|
106
|
-
<wsdl:output>
|
107
|
-
<soap:body use="literal" />
|
108
|
-
</wsdl:output>
|
109
|
-
</wsdl:operation>
|
110
|
-
</wsdl:binding>
|
111
|
-
<wsdl:service name="CalculatorService">
|
112
|
-
<wsdl:port name="ICalculator" binding="tns:DefaultBinding_ICalculator">
|
113
|
-
<soap:address location="http://Example.org/ICalculator" />
|
114
|
-
</wsdl:port>
|
115
|
-
</wsdl:service>
|
116
|
-
</wsdl:definitions>
|
1
|
+
<wsdl:definitions
|
2
|
+
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
3
|
+
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
|
4
|
+
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
|
5
|
+
xmlns:tns="http://Example.org"
|
6
|
+
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
|
7
|
+
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
|
8
|
+
xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy"
|
9
|
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
10
|
+
xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract"
|
11
|
+
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
|
12
|
+
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
|
13
|
+
xmlns:wsa10="http://www.w3.org/2005/08/addressing"
|
14
|
+
xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" targetNamespace="http://Example.org"
|
15
|
+
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
|
16
|
+
<wsdl:types>
|
17
|
+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
18
|
+
targetNamespace="https://www.w3schools.com"
|
19
|
+
xmlns="https://www.w3schools.com"
|
20
|
+
elementFormDefault="qualified">
|
21
|
+
|
22
|
+
<xs:element name="note">
|
23
|
+
<xs:complexType>
|
24
|
+
<xs:sequence>
|
25
|
+
<xs:element name="to" type="xs:string"/>
|
26
|
+
<xs:element name="from" type="xs:string"/>
|
27
|
+
<xs:element name="heading" type="xs:string"/>
|
28
|
+
<xs:element name="body" type="xs:string"/>
|
29
|
+
</xs:sequence>
|
30
|
+
</xs:complexType>
|
31
|
+
</xs:element>
|
32
|
+
|
33
|
+
</xs:schema>
|
34
|
+
<s:schema xmlns:s="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.webserviceX.NET">
|
35
|
+
<s:element name="GetWeather">
|
36
|
+
<s:complexType>
|
37
|
+
<s:sequence>
|
38
|
+
<s:element minOccurs="0" maxOccurs="1" name="CityName" type="s:string"/>
|
39
|
+
<s:element minOccurs="0" maxOccurs="1" name="CountryName" type="s:string"/>
|
40
|
+
</s:sequence>
|
41
|
+
</s:complexType>
|
42
|
+
</s:element>
|
43
|
+
<s:element name="GetWeatherResponse">
|
44
|
+
<s:complexType>
|
45
|
+
<s:sequence>
|
46
|
+
<s:element minOccurs="0" maxOccurs="1" name="GetWeatherResult" type="s:string"/>
|
47
|
+
</s:sequence>
|
48
|
+
</s:complexType>
|
49
|
+
</s:element>
|
50
|
+
<s:element name="GetCitiesByCountry">
|
51
|
+
<s:complexType>
|
52
|
+
<s:sequence>
|
53
|
+
<s:element minOccurs="0" maxOccurs="1" name="CountryName" type="s:string"/>
|
54
|
+
</s:sequence>
|
55
|
+
</s:complexType>
|
56
|
+
</s:element>
|
57
|
+
<s:element name="GetCitiesByCountryResponse">
|
58
|
+
<s:complexType>
|
59
|
+
<s:sequence>
|
60
|
+
<s:element minOccurs="0" maxOccurs="1" name="GetCitiesByCountryResult" type="s:string"/>
|
61
|
+
</s:sequence>
|
62
|
+
</s:complexType>
|
63
|
+
</s:element>
|
64
|
+
<s:element name="string" nillable="true" type="s:string"/>
|
65
|
+
</s:schema>
|
66
|
+
|
67
|
+
</wsdl:types>
|
68
|
+
<wsdl:message name="ICalculator_Add_InputMessage">
|
69
|
+
<wsdl:part name="parameters" element="tns:Add" />
|
70
|
+
</wsdl:message>
|
71
|
+
<wsdl:message name="ICalculator_Add_OutputMessage">
|
72
|
+
<wsdl:part name="parameters" element="tns:AddResponse" />
|
73
|
+
</wsdl:message>
|
74
|
+
<wsdl:message name="ICalculator_Subtract_InputMessage">
|
75
|
+
<wsdl:part name="parameters" element="tns:Subtract" />
|
76
|
+
</wsdl:message>
|
77
|
+
<wsdl:message name="ICalculator_Subtract_OutputMessage">
|
78
|
+
<wsdl:part name="parameters" element="tns:SubtractResponse" />
|
79
|
+
</wsdl:message>
|
80
|
+
<wsdl:portType name="ICalculator">
|
81
|
+
<wsdl:operation name="Add">
|
82
|
+
<wsdl:input wsaw:Action="http://Example.org/ICalculator/Add" message="tns:ICalculator_Add_InputMessage" />
|
83
|
+
<wsdl:output wsaw:Action="http://Example.org/ICalculator/AddResponse" message="tns:ICalculator_Add_OutputMessage" />
|
84
|
+
</wsdl:operation>
|
85
|
+
<wsdl:operation name="Subtract">
|
86
|
+
<wsdl:input wsaw:Action="http://Example.org/ICalculator/Subtract" message="tns:ICalculator_Subtract_InputMessage" />
|
87
|
+
<wsdl:output wsaw:Action="http://Example.org/ICalculator/SubtractResponse" message="tns:ICalculator_Subtract_OutputMessage" />
|
88
|
+
</wsdl:operation>
|
89
|
+
</wsdl:portType>
|
90
|
+
<wsdl:binding name="DefaultBinding_ICalculator" type="tns:ICalculator">
|
91
|
+
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
|
92
|
+
<wsdl:operation name="Add">
|
93
|
+
<soap:operation soapAction="http://Example.org/ICalculator/Add" style="document" />
|
94
|
+
<wsdl:input>
|
95
|
+
<soap:body use="literal" />
|
96
|
+
</wsdl:input>
|
97
|
+
<wsdl:output>
|
98
|
+
<soap:body use="literal" />
|
99
|
+
</wsdl:output>
|
100
|
+
</wsdl:operation>
|
101
|
+
<wsdl:operation name="Subtract">
|
102
|
+
<soap:operation soapAction="http://Example.org/ICalculator/Subtract" style="document" />
|
103
|
+
<wsdl:input>
|
104
|
+
<soap:body use="literal" />
|
105
|
+
</wsdl:input>
|
106
|
+
<wsdl:output>
|
107
|
+
<soap:body use="literal" />
|
108
|
+
</wsdl:output>
|
109
|
+
</wsdl:operation>
|
110
|
+
</wsdl:binding>
|
111
|
+
<wsdl:service name="CalculatorService">
|
112
|
+
<wsdl:port name="ICalculator" binding="tns:DefaultBinding_ICalculator">
|
113
|
+
<soap:address location="http://Example.org/ICalculator" />
|
114
|
+
</wsdl:port>
|
115
|
+
</wsdl:service>
|
116
|
+
</wsdl:definitions>
|
data/test.xml
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
<?xml version="1.0"?>
|
2
|
-
|
3
|
-
<note
|
4
|
-
xmlns="https://www.w3schools.com"
|
5
|
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
6
|
-
xsi:schemaLocation="https://www.w3schools.com/xml/note.xsd">
|
7
|
-
<to>Tove</to>
|
8
|
-
<from>123.2</from>
|
9
|
-
<heading>Reminder</heading>
|
10
|
-
<body>Don't forget me this weekend!</body>
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
|
3
|
+
<note
|
4
|
+
xmlns="https://www.w3schools.com"
|
5
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
6
|
+
xsi:schemaLocation="https://www.w3schools.com/xml/note.xsd">
|
7
|
+
<to>Tove</to>
|
8
|
+
<from>123.2</from>
|
9
|
+
<heading>Reminder</heading>
|
10
|
+
<body>Don't forget me this weekend!</body>
|
11
11
|
</note>
|
data/test_wsdl.rb
CHANGED
@@ -1,43 +1,43 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'wasabi'
|
4
|
-
require 'savon'
|
5
|
-
|
6
|
-
# document = Savon.client(wsdl: 'test.wsdl').wsdl
|
7
|
-
# document = Savon.client(wsdl: 'http://www.webservicex.com/globalweather.asmx?wsdl').wsdl
|
8
|
-
# document = Wasabi.document File.read('test.wsdl')
|
9
|
-
document = Wasabi.document 'http://www.webservicex.net/ConvertTemperature.asmx?WSDL'
|
10
|
-
parser = document.parser
|
11
|
-
|
12
|
-
# TEST SCHEMA
|
13
|
-
#
|
14
|
-
# parser.schemas.each do |schema|
|
15
|
-
# puts 'SCHEMA * '
|
16
|
-
# puts schema
|
17
|
-
#
|
18
|
-
# xsd = Nokogiri::XML::Schema(schema.to_s)
|
19
|
-
#
|
20
|
-
# doc = Nokogiri::XML(File.read('test.xml'))
|
21
|
-
#
|
22
|
-
# xsd.validate(doc).each do |error|
|
23
|
-
# puts error.message
|
24
|
-
# end
|
25
|
-
# end
|
26
|
-
#
|
27
|
-
|
28
|
-
schemes = parser.schemas
|
29
|
-
puts schemes
|
30
|
-
custom_type = schemes.xpath("//*[@name='TemperatureUnit']")
|
31
|
-
if custom_type.first
|
32
|
-
puts 'CUST' + custom_type.to_s
|
33
|
-
prefix = custom_type.first.namespace.prefix
|
34
|
-
puts prefix
|
35
|
-
|
36
|
-
enumerations = custom_type.xpath("//#{prefix}:enumeration")
|
37
|
-
|
38
|
-
puts 'ENUM' + enumerations.to_s
|
39
|
-
|
40
|
-
enumerations.each do |enum_value|
|
41
|
-
puts enum_value['value']
|
42
|
-
end
|
43
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'wasabi'
|
4
|
+
require 'savon'
|
5
|
+
|
6
|
+
# document = Savon.client(wsdl: 'test.wsdl').wsdl
|
7
|
+
# document = Savon.client(wsdl: 'http://www.webservicex.com/globalweather.asmx?wsdl').wsdl
|
8
|
+
# document = Wasabi.document File.read('test.wsdl')
|
9
|
+
document = Wasabi.document 'http://www.webservicex.net/ConvertTemperature.asmx?WSDL'
|
10
|
+
parser = document.parser
|
11
|
+
|
12
|
+
# TEST SCHEMA
|
13
|
+
#
|
14
|
+
# parser.schemas.each do |schema|
|
15
|
+
# puts 'SCHEMA * '
|
16
|
+
# puts schema
|
17
|
+
#
|
18
|
+
# xsd = Nokogiri::XML::Schema(schema.to_s)
|
19
|
+
#
|
20
|
+
# doc = Nokogiri::XML(File.read('test.xml'))
|
21
|
+
#
|
22
|
+
# xsd.validate(doc).each do |error|
|
23
|
+
# puts error.message
|
24
|
+
# end
|
25
|
+
# end
|
26
|
+
#
|
27
|
+
|
28
|
+
schemes = parser.schemas
|
29
|
+
puts schemes
|
30
|
+
custom_type = schemes.xpath("//*[@name='TemperatureUnit']")
|
31
|
+
if custom_type.first
|
32
|
+
puts 'CUST' + custom_type.to_s
|
33
|
+
prefix = custom_type.first.namespace.prefix
|
34
|
+
puts prefix
|
35
|
+
|
36
|
+
enumerations = custom_type.xpath("//#{prefix}:enumeration")
|
37
|
+
|
38
|
+
puts 'ENUM' + enumerations.to_s
|
39
|
+
|
40
|
+
enumerations.each do |enum_value|
|
41
|
+
puts enum_value['value']
|
42
|
+
end
|
43
|
+
end
|