soaspec 0.0.88 → 0.0.89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +15 -15
  3. data/.gitlab-ci.yml +31 -31
  4. data/.rspec +3 -3
  5. data/.rubocop.yml +2 -2
  6. data/CODE_OF_CONDUCT.md +74 -74
  7. data/ChangeLog +374 -370
  8. data/Gemfile +6 -6
  9. data/LICENSE.txt +21 -21
  10. data/README.md +85 -85
  11. data/Rakefile +24 -24
  12. data/Todo.md +6 -6
  13. data/exe/soaspec +119 -123
  14. data/exe/soaspec-virtual-server +98 -98
  15. data/exe/xml_to_yaml_file +60 -60
  16. data/lib/soaspec.rb +80 -80
  17. data/lib/soaspec/core_ext/hash.rb +83 -83
  18. data/lib/soaspec/exchange.rb +234 -234
  19. data/lib/soaspec/exchange_handlers/exchange_handler.rb +103 -103
  20. data/lib/soaspec/exchange_handlers/handler_accessors.rb +106 -106
  21. data/lib/soaspec/exchange_handlers/rest_accessors.rb +92 -95
  22. data/lib/soaspec/exchange_handlers/rest_handler.rb +296 -296
  23. data/lib/soaspec/exchange_handlers/rest_methods.rb +44 -44
  24. data/lib/soaspec/exchange_handlers/soap_handler.rb +236 -236
  25. data/lib/soaspec/exe_helpers.rb +56 -56
  26. data/lib/soaspec/generator/.rspec.erb +5 -5
  27. data/lib/soaspec/generator/.travis.yml.erb +5 -5
  28. data/lib/soaspec/generator/Gemfile.erb +8 -8
  29. data/lib/soaspec/generator/README.md.erb +29 -29
  30. data/lib/soaspec/generator/Rakefile.erb +19 -19
  31. data/lib/soaspec/generator/config/data/default.yml.erb +1 -1
  32. data/lib/soaspec/generator/lib/blz_service.rb.erb +26 -26
  33. data/lib/soaspec/generator/lib/dynamic_class_content.rb.erb +12 -12
  34. data/lib/soaspec/generator/lib/shared_example.rb.erb +8 -8
  35. data/lib/soaspec/generator/spec/dynamic_soap_spec.rb.erb +12 -12
  36. data/lib/soaspec/generator/spec/soap_spec.rb.erb +51 -51
  37. data/lib/soaspec/generator/spec/spec_helper.rb.erb +20 -20
  38. data/lib/soaspec/generator/template/soap_template.xml +6 -6
  39. data/lib/soaspec/interpreter.rb +40 -40
  40. data/lib/soaspec/matchers.rb +65 -65
  41. data/lib/soaspec/not_found_errors.rb +13 -13
  42. data/lib/soaspec/soaspec_shared_examples.rb +24 -24
  43. data/lib/soaspec/spec_logger.rb +27 -27
  44. data/lib/soaspec/test_server/bank.wsdl +90 -90
  45. data/lib/soaspec/test_server/get_bank.rb +160 -160
  46. data/lib/soaspec/test_server/invoices.rb +27 -27
  47. data/lib/soaspec/test_server/namespace.xml +14 -14
  48. data/lib/soaspec/test_server/note.xml +5 -5
  49. data/lib/soaspec/test_server/puppy_service.rb +20 -20
  50. data/lib/soaspec/test_server/test_attribute.rb +13 -13
  51. data/lib/soaspec/version.rb +2 -2
  52. data/lib/soaspec/wsdl_generator.rb +115 -93
  53. data/soaspec.gemspec +45 -45
  54. data/test.wsdl +116 -116
  55. data/test.xml +10 -10
  56. data/test_wsdl.rb +43 -43
  57. metadata +3 -3
@@ -1,13 +1,13 @@
1
-
2
- module Soaspec
3
- module TestServer
4
- # Helps tests attribute methods
5
- class TestAttribute
6
- class << self
7
- def note
8
- File.read(File.join(File.dirname(__FILE__), 'note.xml'))
9
- end
10
- end
11
- end
12
- end
13
- end
1
+
2
+ module Soaspec
3
+ module TestServer
4
+ # Helps tests attribute methods
5
+ class TestAttribute
6
+ class << self
7
+ def note
8
+ File.read(File.join(File.dirname(__FILE__), 'note.xml'))
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -1,3 +1,3 @@
1
- module Soaspec
2
- VERSION = '0.0.88'.freeze
1
+ module Soaspec
2
+ VERSION = '0.0.89'.freeze
3
3
  end
@@ -1,94 +1,116 @@
1
-
2
- module Soaspec
3
- module WsdlGenerator
4
- def try_enum_for(type)
5
- custom_type = @wsdl_schemas.xpath("//*[@name='#{type}']")
6
- if custom_type.first
7
- prefix = custom_type.first.namespace.prefix
8
- enumerations = custom_type.xpath("//#{prefix}:enumeration")
9
- return 'Custom Type' if enumerations.empty?
10
- @enums_values = Array.new
11
- enumerations.each do |enum_value|
12
- @enums_values << "'#{enum_value['value']}'"
13
- end
14
- "~randomize [#{@enums_values.join(', ')}]"
15
- else
16
- 'Custom Type'
17
- end
18
- end
19
-
20
- def value_after_namespace(string)
21
- string.split(':').last
22
- end
23
-
24
- # Based on WSDL type return a valid value
25
- # @param [String] type Type without the WSDL
26
- def fill_in_field_from_type(type)
27
- case type
28
- when 'string'
29
- options[:string_default] # 'test string'
30
- when 'int'
31
- 2
32
- when 'boolean'
33
- true
34
- when 'double'
35
- '1.5'
36
- else
37
- try_enum_for type
38
- end
39
- end
40
-
41
- # @param [String, Symbol] underscore_separated Snakecase value to be converted to camel case
42
- def camel_case(underscore_separated)
43
- underscore_separated.to_s.split('_').collect(&:capitalize).join
44
- end
45
-
46
- # @param [Nokogiri::NodeSet] list List
47
- def wsdl_to_yaml_for(list)
48
- puts list
49
- list.each do |element|
50
- name = element['name']
51
- type = value_after_namespace(element['type'])
52
- puts 'Name ' + name + ' type ' + type
53
- @use_camel_case = true if (/[[:upper:]]/.match(name[0]) != nil)
54
- @content += " #{name.snakecase}: #{fill_in_field_from_type(type)} # #{type} \n"
55
- # TODO: If details is a Hash need to loop again
56
- end
57
- end
58
-
59
- def ask_wsdl
60
- prompt = <<-EOF
61
- Enter WSDL:
62
- EOF
63
- print prompt.chop
64
- @wsdl = $stdin.gets.strip
65
- puts
66
- end
67
-
68
- def name_of_wsdl
69
- prompt = <<-EOF
70
- Enter what you would like to name WSDL (CamelCase):
71
- EOF
72
- print prompt.chop
73
- @name = $stdin.gets.strip
74
- puts
75
- end
76
-
77
- # Prompt user to enter basic auth details
78
- def enter_auth_details
79
- prompt = <<-EOF
80
- User Name:
81
- EOF
82
- print prompt.chop
83
- @auth_name = $stdin.gets.strip
84
- puts
85
-
86
- prompt = <<-EOF
87
- User Password:
88
- EOF
89
- print prompt.chop
90
- @auth_password = $stdin.gets.strip
91
- puts
92
- end
93
- end
1
+
2
+ module Soaspec
3
+ module WsdlGenerator
4
+ # Attempt to calculate values of enumeration by looking up type in Schema
5
+ def try_enum_for(type)
6
+ raise "'@wsdl_schemas' must be defined" if @wsdl_schemas.nil?
7
+ custom_type = @wsdl_schemas.xpath("//*[@name='#{type}']")
8
+ if custom_type.first
9
+ prefix = custom_type.first.namespace.prefix
10
+ enumerations = custom_type.xpath("//#{prefix}:enumeration")
11
+ return 'Custom Type' if enumerations.empty?
12
+ @enums_values = []
13
+ enumerations.each { |enum_value| @enums_values << "'#{enum_value['value']}'" }
14
+ "~randomize [#{@enums_values.join(', ')}]"
15
+ else
16
+ 'Custom Type'
17
+ end
18
+ end
19
+
20
+ # Return value of string after a namespace
21
+ # @param [String] string String to parse for part after namespace
22
+ def value_after_namespace(string)
23
+ string.split(':').last
24
+ end
25
+
26
+ # Based on WSDL type return a valid value
27
+ # @param [String] type Type without the WSDL
28
+ def fill_in_field_from_type(type)
29
+ case type
30
+ when 'string'
31
+ options[:string_default] # 'test string'
32
+ when 'int'
33
+ 2
34
+ when 'boolean'
35
+ true
36
+ when 'double'
37
+ '1.5'
38
+ else
39
+ try_enum_for type
40
+ end
41
+ end
42
+
43
+ # @param [String, Symbol] underscore_separated Snakecase value to be converted to camel case
44
+ def camel_case(underscore_separated)
45
+ underscore_separated.to_s.split('_').collect(&:capitalize).join
46
+ end
47
+
48
+ # @param [Hash] op_details Hash with details from WSDL for an operation
49
+ # @return [Nokogiri::XML::NodeSet] List of the root elements in the SOAP body
50
+ def root_elements_for(op_details)
51
+ raise "'@wsdl_schemas' must be defined" if @wsdl_schemas.nil?
52
+ root_element = @wsdl_schemas.at_xpath("//*[@name='#{op_details[:input]}']")
53
+ raise 'Operation has no input defined' if root_element.nil?
54
+ schema_namespace = root_element.namespace.prefix
55
+
56
+ root_type = root_element['type']
57
+ if root_type
58
+ @wsdl_schemas.xpath("//*[@name='#{root_type.split(':').last}']//#{schema_namespace}:element")
59
+ else
60
+ return [] unless root_element.children.any? { |child| child.name == 'complexType' } # Empty Array if there are no root elements
61
+ root_element.xpath("//#{schema_namespace}:element")
62
+ end
63
+ end
64
+
65
+ # @param [Nokogiri::NodeSet] list List
66
+ def wsdl_to_yaml_for(list)
67
+ raise "'@content' string must be set" if @content.nil?
68
+ puts list
69
+ list.each do |element|
70
+ name = element['name']
71
+ type = value_after_namespace(element['type'])
72
+ puts 'Name ' + name + ' type ' + type
73
+ @use_camel_case = true if (/[[:upper:]]/.match(name[0]) != nil)
74
+ @content += " #{name.snakecase}: #{fill_in_field_from_type(type)} # #{type} \n"
75
+ # TODO: If it is nested need to loop again
76
+ end
77
+ end
78
+
79
+ # Prompt user for wsdl
80
+ def ask_wsdl
81
+ prompt = <<-EOF
82
+ Enter WSDL:
83
+ EOF
84
+ print prompt.chop
85
+ @wsdl = $stdin.gets.strip
86
+ puts
87
+ end
88
+
89
+ # Prompt user for Service name for wsdl
90
+ def name_of_wsdl
91
+ prompt = <<-EOF
92
+ Enter what you would like to name WSDL (CamelCase):
93
+ EOF
94
+ print prompt.chop
95
+ @name = $stdin.gets.strip
96
+ puts
97
+ end
98
+
99
+ # Prompt user to enter basic auth details
100
+ def enter_auth_details
101
+ prompt = <<-EOF
102
+ User Name:
103
+ EOF
104
+ print prompt.chop
105
+ @auth_name = $stdin.gets.strip
106
+ puts
107
+
108
+ prompt = <<-EOF
109
+ User Password:
110
+ EOF
111
+ print prompt.chop
112
+ @auth_password = $stdin.gets.strip
113
+ puts
114
+ end
115
+ end
94
116
  end
data/soaspec.gemspec CHANGED
@@ -1,45 +1,45 @@
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'
31
- spec.add_development_dependency 'rspec', '~> 3.0'
32
- spec.add_development_dependency 'simplecov'
33
- spec.add_dependency 'hashie'
34
- spec.add_dependency 'jsonpath'
35
- spec.add_dependency 'nokogiri'
36
- spec.add_dependency 'rest-client', '>= 2.0' # REST
37
- spec.add_dependency 'rspec', '~> 3.0' # This framework is designed to work with RSpec
38
- spec.add_dependency 'rspec-its', '>= 1.2.0'
39
- spec.add_dependency 'savon', '>= 2' # SOAP
40
- spec.add_dependency 'sinatra'
41
- spec.add_dependency 'sinatra-basic-auth'
42
- spec.add_dependency 'thor'
43
- spec.add_dependency 'xml-simple', '>= 1.1.5'
44
-
45
- 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'
31
+ spec.add_development_dependency 'rspec', '~> 3.0'
32
+ spec.add_development_dependency 'simplecov'
33
+ spec.add_dependency 'hashie'
34
+ spec.add_dependency 'jsonpath'
35
+ spec.add_dependency 'nokogiri'
36
+ spec.add_dependency 'rest-client', '>= 2.0' # REST
37
+ spec.add_dependency 'rspec', '~> 3.0' # This framework is designed to work with RSpec
38
+ spec.add_dependency 'rspec-its', '>= 1.2.0'
39
+ spec.add_dependency 'savon', '>= 2' # SOAP
40
+ spec.add_dependency 'sinatra'
41
+ spec.add_dependency 'sinatra-basic-auth'
42
+ spec.add_dependency 'thor'
43
+ spec.add_dependency 'xml-simple', '>= 1.1.5'
44
+
45
+ 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>