soaspec 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +15 -15
- data/.gitlab-ci.yml +48 -48
- data/.rspec +3 -3
- data/.rubocop.yml +2 -2
- data/CODE_OF_CONDUCT.md +74 -74
- data/ChangeLog +408 -404
- data/Gemfile +6 -6
- data/LICENSE.txt +21 -21
- data/README.md +113 -113
- data/Rakefile +24 -24
- data/Todo.md +6 -6
- data/exe/soaspec +109 -109
- data/exe/soaspec-virtual-server +156 -156
- data/exe/xml_to_yaml_file +60 -60
- data/lib/soaspec.rb +107 -103
- data/lib/soaspec/core_ext/hash.rb +83 -83
- data/lib/soaspec/exchange.rb +235 -235
- data/lib/soaspec/exchange_handlers/exchange_handler.rb +103 -103
- data/lib/soaspec/exchange_handlers/handler_accessors.rb +106 -106
- data/lib/soaspec/exchange_handlers/rest_accessors.rb +54 -92
- data/lib/soaspec/exchange_handlers/rest_handler.rb +318 -314
- data/lib/soaspec/exchange_handlers/rest_methods.rb +44 -44
- data/lib/soaspec/exchange_handlers/soap_handler.rb +236 -236
- data/lib/soaspec/exe_helpers.rb +60 -60
- 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 +1 -1
- 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/shared_example.rb.erb +8 -8
- data/lib/soaspec/generator/spec/dynamic_soap_spec.rb.erb +12 -12
- data/lib/soaspec/generator/spec/soap_spec.rb.erb +51 -51
- data/lib/soaspec/generator/spec/spec_helper.rb.erb +20 -20
- data/lib/soaspec/generator/template/soap_template.xml +6 -6
- data/lib/soaspec/interpreter.rb +40 -40
- data/lib/soaspec/matchers.rb +65 -65
- data/lib/soaspec/not_found_errors.rb +13 -13
- data/lib/soaspec/o_auth2.rb +65 -0
- data/lib/soaspec/soaspec_shared_examples.rb +24 -24
- data/lib/soaspec/spec_logger.rb +34 -27
- data/lib/soaspec/test_server/bank.wsdl +90 -90
- data/lib/soaspec/test_server/get_bank.rb +160 -160
- data/lib/soaspec/test_server/id_manager.rb +31 -31
- data/lib/soaspec/test_server/invoices.rb +27 -27
- 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 +20 -20
- data/lib/soaspec/test_server/test_attribute.rb +13 -13
- data/lib/soaspec/test_server/test_namespace.rb +12 -12
- data/lib/soaspec/version.rb +2 -2
- data/lib/soaspec/wsdl_generator.rb +144 -144
- data/soaspec.gemspec +46 -46
- data/test.wsdl +116 -116
- data/test.xml +10 -10
- data/test_wsdl.rb +43 -43
- metadata +4 -3
data/soaspec.gemspec
CHANGED
@@ -1,46 +1,46 @@
|
|
1
|
-
|
2
|
-
lib = File.expand_path('lib', __dir__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'soaspec/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = 'soaspec'
|
8
|
-
spec.version = Soaspec::VERSION
|
9
|
-
spec.authors = ['SamuelGarrattIQA']
|
10
|
-
spec.email = ['samuel.garratt@integrationqa.com']
|
11
|
-
|
12
|
-
spec.summary = "Helps to create RSpec specs for 'SOAP' or 'REST' apis "
|
13
|
-
spec.description = "Helps to create RSpec specs for 'SOAP' or 'REST' apis. Easily represent multiple requests with
|
14
|
-
the same configuration "
|
15
|
-
spec.homepage = 'https://gitlab.com/samuel-garratt/soaspec'
|
16
|
-
spec.license = 'MIT'
|
17
|
-
|
18
|
-
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
19
|
-
f.match(%r{^(test|spec|features|bin|config|template|credentials)/})
|
20
|
-
end
|
21
|
-
spec.bindir = 'exe'
|
22
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
|
-
spec.require_paths = ['lib']
|
24
|
-
|
25
|
-
spec.add_development_dependency 'bundler', '~> 1.16'
|
26
|
-
spec.add_development_dependency 'cucumber'
|
27
|
-
spec.add_development_dependency 'data_magic'
|
28
|
-
spec.add_development_dependency 'factory_bot'
|
29
|
-
spec.add_development_dependency 'rake', '~> 12.0'
|
30
|
-
spec.add_development_dependency 'require_all', '1.5.0'
|
31
|
-
spec.add_development_dependency 'rspec', '~> 3.0'
|
32
|
-
spec.add_development_dependency 'simplecov'
|
33
|
-
spec.add_dependency 'faker'
|
34
|
-
spec.add_dependency 'hashie'
|
35
|
-
spec.add_dependency 'jsonpath'
|
36
|
-
spec.add_dependency 'nokogiri'
|
37
|
-
spec.add_dependency 'rest-client', '>= 2.0' # REST
|
38
|
-
spec.add_dependency 'rspec', '~> 3.0' # This framework is designed to work with RSpec
|
39
|
-
spec.add_dependency 'rspec-its', '>= 1.2.0'
|
40
|
-
spec.add_dependency 'savon', '>= 2' # SOAP
|
41
|
-
spec.add_dependency 'sinatra'
|
42
|
-
spec.add_dependency 'sinatra-basic-auth'
|
43
|
-
spec.add_dependency 'sinatra-docdsl'
|
44
|
-
spec.add_dependency 'thor'
|
45
|
-
spec.add_dependency 'xml-simple', '>= 1.1.5'
|
46
|
-
end
|
1
|
+
|
2
|
+
lib = File.expand_path('lib', __dir__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'soaspec/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'soaspec'
|
8
|
+
spec.version = Soaspec::VERSION
|
9
|
+
spec.authors = ['SamuelGarrattIQA']
|
10
|
+
spec.email = ['samuel.garratt@integrationqa.com']
|
11
|
+
|
12
|
+
spec.summary = "Helps to create RSpec specs for 'SOAP' or 'REST' apis "
|
13
|
+
spec.description = "Helps to create RSpec specs for 'SOAP' or 'REST' apis. Easily represent multiple requests with
|
14
|
+
the same configuration "
|
15
|
+
spec.homepage = 'https://gitlab.com/samuel-garratt/soaspec'
|
16
|
+
spec.license = 'MIT'
|
17
|
+
|
18
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
19
|
+
f.match(%r{^(test|spec|features|bin|config|template|credentials)/})
|
20
|
+
end
|
21
|
+
spec.bindir = 'exe'
|
22
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
|
+
spec.require_paths = ['lib']
|
24
|
+
|
25
|
+
spec.add_development_dependency 'bundler', '~> 1.16'
|
26
|
+
spec.add_development_dependency 'cucumber'
|
27
|
+
spec.add_development_dependency 'data_magic'
|
28
|
+
spec.add_development_dependency 'factory_bot'
|
29
|
+
spec.add_development_dependency 'rake', '~> 12.0'
|
30
|
+
spec.add_development_dependency 'require_all', '1.5.0'
|
31
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
32
|
+
spec.add_development_dependency 'simplecov'
|
33
|
+
spec.add_dependency 'faker'
|
34
|
+
spec.add_dependency 'hashie'
|
35
|
+
spec.add_dependency 'jsonpath'
|
36
|
+
spec.add_dependency 'nokogiri'
|
37
|
+
spec.add_dependency 'rest-client', '>= 2.0' # REST
|
38
|
+
spec.add_dependency 'rspec', '~> 3.0' # This framework is designed to work with RSpec
|
39
|
+
spec.add_dependency 'rspec-its', '>= 1.2.0'
|
40
|
+
spec.add_dependency 'savon', '>= 2' # SOAP
|
41
|
+
spec.add_dependency 'sinatra'
|
42
|
+
spec.add_dependency 'sinatra-basic-auth'
|
43
|
+
spec.add_dependency 'sinatra-docdsl'
|
44
|
+
spec.add_dependency 'thor'
|
45
|
+
spec.add_dependency 'xml-simple', '>= 1.1.5'
|
46
|
+
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,44 +1,44 @@
|
|
1
|
-
|
2
|
-
require 'wasabi'
|
3
|
-
require 'savon'
|
4
|
-
|
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
|
-
|
13
|
-
# TEST SCHEMA
|
14
|
-
#
|
15
|
-
# parser.schemas.each do |schema|
|
16
|
-
# puts 'SCHEMA * '
|
17
|
-
# puts schema
|
18
|
-
#
|
19
|
-
# xsd = Nokogiri::XML::Schema(schema.to_s)
|
20
|
-
#
|
21
|
-
# doc = Nokogiri::XML(File.read('test.xml'))
|
22
|
-
#
|
23
|
-
# xsd.validate(doc).each do |error|
|
24
|
-
# puts error.message
|
25
|
-
# end
|
26
|
-
# end
|
27
|
-
#
|
28
|
-
|
29
|
-
schemes = parser.schemas
|
30
|
-
puts schemes
|
31
|
-
custom_type = schemes.xpath("//*[@name='TemperatureUnit']")
|
32
|
-
if custom_type.first
|
33
|
-
puts 'CUST' + custom_type.to_s
|
34
|
-
prefix = custom_type.first.namespace.prefix
|
35
|
-
puts prefix
|
36
|
-
|
37
|
-
enumerations = custom_type.xpath("//#{prefix}:enumeration")
|
38
|
-
|
39
|
-
puts 'ENUM' + enumerations.to_s
|
40
|
-
|
41
|
-
enumerations.each do |enum_value|
|
42
|
-
puts enum_value['value']
|
43
|
-
end
|
1
|
+
|
2
|
+
require 'wasabi'
|
3
|
+
require 'savon'
|
4
|
+
|
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
|
+
|
13
|
+
# TEST SCHEMA
|
14
|
+
#
|
15
|
+
# parser.schemas.each do |schema|
|
16
|
+
# puts 'SCHEMA * '
|
17
|
+
# puts schema
|
18
|
+
#
|
19
|
+
# xsd = Nokogiri::XML::Schema(schema.to_s)
|
20
|
+
#
|
21
|
+
# doc = Nokogiri::XML(File.read('test.xml'))
|
22
|
+
#
|
23
|
+
# xsd.validate(doc).each do |error|
|
24
|
+
# puts error.message
|
25
|
+
# end
|
26
|
+
# end
|
27
|
+
#
|
28
|
+
|
29
|
+
schemes = parser.schemas
|
30
|
+
puts schemes
|
31
|
+
custom_type = schemes.xpath("//*[@name='TemperatureUnit']")
|
32
|
+
if custom_type.first
|
33
|
+
puts 'CUST' + custom_type.to_s
|
34
|
+
prefix = custom_type.first.namespace.prefix
|
35
|
+
puts prefix
|
36
|
+
|
37
|
+
enumerations = custom_type.xpath("//#{prefix}:enumeration")
|
38
|
+
|
39
|
+
puts 'ENUM' + enumerations.to_s
|
40
|
+
|
41
|
+
enumerations.each do |enum_value|
|
42
|
+
puts enum_value['value']
|
43
|
+
end
|
44
44
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soaspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SamuelGarrattIQA
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -355,6 +355,7 @@ files:
|
|
355
355
|
- lib/soaspec/interpreter.rb
|
356
356
|
- lib/soaspec/matchers.rb
|
357
357
|
- lib/soaspec/not_found_errors.rb
|
358
|
+
- lib/soaspec/o_auth2.rb
|
358
359
|
- lib/soaspec/soaspec_shared_examples.rb
|
359
360
|
- lib/soaspec/spec_logger.rb
|
360
361
|
- lib/soaspec/test_server/bank.wsdl
|
@@ -392,7 +393,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
392
393
|
version: '0'
|
393
394
|
requirements: []
|
394
395
|
rubyforge_project:
|
395
|
-
rubygems_version: 2.
|
396
|
+
rubygems_version: 2.6.14
|
396
397
|
signing_key:
|
397
398
|
specification_version: 4
|
398
399
|
summary: Helps to create RSpec specs for 'SOAP' or 'REST' apis
|