soaspec 0.0.85 → 0.0.86

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) 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/.travis.yml +5 -5
  7. data/CODE_OF_CONDUCT.md +74 -74
  8. data/ChangeLog +362 -358
  9. data/Gemfile +6 -6
  10. data/LICENSE.txt +21 -21
  11. data/README.md +85 -85
  12. data/Rakefile +24 -24
  13. data/Todo.md +6 -6
  14. data/exe/soaspec +123 -123
  15. data/exe/soaspec-virtual-server +98 -98
  16. data/exe/xml_to_yaml_file +60 -60
  17. data/lib/soaspec.rb +80 -73
  18. data/lib/soaspec/core_ext/hash.rb +83 -83
  19. data/lib/soaspec/exchange.rb +234 -234
  20. data/lib/soaspec/exchange_handlers/exchange_handler.rb +103 -103
  21. data/lib/soaspec/exchange_handlers/handler_accessors.rb +106 -106
  22. data/lib/soaspec/exchange_handlers/rest_accessors.rb +97 -83
  23. data/lib/soaspec/exchange_handlers/rest_handler.rb +296 -296
  24. data/lib/soaspec/exchange_handlers/rest_methods.rb +44 -44
  25. data/lib/soaspec/exchange_handlers/soap_handler.rb +236 -236
  26. data/lib/soaspec/exe_helpers.rb +56 -56
  27. data/lib/soaspec/generator/.rspec.erb +5 -5
  28. data/lib/soaspec/generator/.travis.yml.erb +5 -5
  29. data/lib/soaspec/generator/Gemfile.erb +8 -8
  30. data/lib/soaspec/generator/README.md.erb +29 -29
  31. data/lib/soaspec/generator/Rakefile.erb +19 -19
  32. data/lib/soaspec/generator/config/data/default.yml.erb +1 -1
  33. data/lib/soaspec/generator/lib/blz_service.rb.erb +26 -26
  34. data/lib/soaspec/generator/lib/dynamic_class_content.rb.erb +12 -12
  35. data/lib/soaspec/generator/lib/shared_example.rb.erb +8 -8
  36. data/lib/soaspec/generator/spec/dynamic_soap_spec.rb.erb +12 -12
  37. data/lib/soaspec/generator/spec/soap_spec.rb.erb +51 -51
  38. data/lib/soaspec/generator/spec/spec_helper.rb.erb +20 -20
  39. data/lib/soaspec/generator/template/soap_template.xml +6 -6
  40. data/lib/soaspec/interpreter.rb +40 -40
  41. data/lib/soaspec/matchers.rb +65 -65
  42. data/lib/soaspec/not_found_errors.rb +13 -13
  43. data/lib/soaspec/soaspec_shared_examples.rb +24 -24
  44. data/lib/soaspec/spec_logger.rb +27 -27
  45. data/lib/soaspec/test_server/bank.wsdl +90 -90
  46. data/lib/soaspec/test_server/get_bank.rb +160 -160
  47. data/lib/soaspec/test_server/invoices.rb +27 -27
  48. data/lib/soaspec/test_server/namespace.xml +14 -14
  49. data/lib/soaspec/test_server/note.xml +5 -5
  50. data/lib/soaspec/test_server/puppy_service.rb +20 -20
  51. data/lib/soaspec/test_server/test_attribute.rb +13 -13
  52. data/lib/soaspec/version.rb +2 -2
  53. data/lib/soaspec/wsdl_generator.rb +93 -93
  54. data/soaspec.gemspec +45 -45
  55. data/test.wsdl +116 -116
  56. data/test.xml +10 -10
  57. data/test_rest.rb +97 -97
  58. data/test_wsdl.rb +43 -43
  59. metadata +3 -3
@@ -1,161 +1,161 @@
1
-
2
- require 'erb'
3
-
4
- module Soaspec
5
- module TestServer
6
- # Representing a GetBank SOAP service
7
- class GetBank
8
-
9
- class << self
10
-
11
- def test_wsdl
12
- ERB.new(File.read(File.join(File.dirname(__FILE__), 'bank.wsdl'))).result(binding)
13
- end
14
-
15
- def success_response_template
16
- <<-EOF
17
- <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
18
- <soapenv:Body>
19
- <ns1:getBankResponse xmlns:ns1="http://thomas-bayer.com/blz/">
20
- <ns1:details unique_id="50">
21
- <ns1:bezeichnung lang="German"><%= @title %></ns1:bezeichnung>
22
- <ns1:bic>DEUTDEMMXXX <%= soap_action %></ns1:bic>
23
- <ns1:ort>München</ns1:ort>
24
- <% if @multiple_ort %>
25
- <ns1:ort>Wellington</ns1:ort>
26
- <ns1:ort>Tokyo</ns1:ort>
27
- <% end %>
28
- <ns1:plz><%= @bank_name %></ns1:plz>
29
- </ns1:details>
30
- </ns1:getBankResponse>
31
- </soapenv:Body>
32
- </soapenv:Envelope>
33
- EOF
34
- end
35
-
36
- def bank_not_found
37
- <<-EOF
38
- <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
39
- <soapenv:Body>
40
- <soapenv:Fault>
41
- <soapenv:Code>
42
- <soapenv:Value>soapenv:Receiver</soapenv:Value>
43
- </soapenv:Code>
44
- <soapenv:Reason>
45
- <soapenv:Text xml:lang="en-US">Keine Bank zur BLZ <%= @bank_name %> gefunden!</soapenv:Text>
46
- </soapenv:Reason>
47
- <soapenv:Detail>
48
- <Exception>org.apache.axis2.AxisFault: Keine Bank zur BLZ test string gefunden!
49
- at com.thomas_bayer.blz.BLZService.getBank(BLZService.java:41)
50
- at com.thomas_bayer.blz.BLZServiceMessageReceiverInOut.invokeBusinessLogic(BLZServiceMessageReceiverInOut.java:49)
51
- at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(AbstractInOutSyncMessageReceiver.java:42)
52
- at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:96)
53
- at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
54
- at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
55
- at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:120)
56
- at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
57
- at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
58
- at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
59
- at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
60
- at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
61
- at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
62
- at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
63
- at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
64
- at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
65
- at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
66
- at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
67
- at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:683)
68
- at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
69
- at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
70
- at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
71
- at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
72
- at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
73
- at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
74
- at java.lang.Thread.run(Thread.java:745)
75
- </Exception>
76
- </soapenv:Detail>
77
- </soapenv:Fault>
78
- </soapenv:Body>
79
- </soapenv:Envelope>
80
- EOF
81
- end
82
-
83
- def error_response_template
84
- <<-EOF
85
- <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
86
- <soapenv:Body>
87
- <soapenv:Fault>
88
- <soapenv:Code>
89
- <soapenv:Value>soapenv:Receiver</soapenv:Value>
90
- </soapenv:Code>
91
- <soapenv:Reason>
92
- <soapenv:Text xml:lang="en-US">org.apache.axis2.databinding.ADBException: Unexpected subelement getBank</soapenv:Text>
93
- </soapenv:Reason>
94
- <soapenv:Detail>
95
- <Exception>org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement getBank
96
- at org.apache.axis2.AxisFault.makeFault(AxisFault.java:417)
97
- at com.thomas_bayer.blz.BLZServiceMessageReceiverInOut.fromOM(BLZServiceMessageReceiverInOut.java:124)
98
- at com.thomas_bayer.blz.BLZServiceMessageReceiverInOut.invokeBusinessLogic(BLZServiceMessageReceiverInOut.java:43)
99
- at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(AbstractInOutSyncMessageReceiver.java:42)
100
- at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:96)
101
- at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
102
- at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
103
- at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:120)
104
- at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
105
- at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
106
- at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
107
- at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
108
- at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
109
- at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
110
- at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
111
- at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
112
- at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
113
- at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
114
- at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
115
- at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:683)
116
- at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
117
- at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
118
- at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
119
- at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
120
- at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
121
- at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
122
- at java.lang.Thread.run(Thread.java:745)
123
- Caused by: java.lang.Exception: org.apache.axis2.databinding.ADBException: Unexpected subelement getBank
124
- at com.thomas_bayer.adb.GetBankType$Factory.parse(GetBankType.java:423)
125
- at com.thomas_bayer.adb.GetBank$Factory.parse(GetBank.java:304)
126
- at com.thomas_bayer.blz.BLZServiceMessageReceiverInOut.fromOM(BLZServiceMessageReceiverInOut.java:117)
127
- ... 25 more
128
- Caused by: org.apache.axis2.databinding.ADBException: Unexpected subelement getBank
129
- at com.thomas_bayer.adb.GetBankType$Factory.parse(GetBankType.java:410)
130
- ... 27 more
131
- </Exception>
132
- </soapenv:Detail>
133
- </soapenv:Fault>
134
- </soapenv:Body>
135
- </soapenv:Envelope>
136
- EOF
137
- end
138
-
139
- # Return a response based upon the SOAP request
140
- # @param [String] request XML in request
141
- def response_for(request)
142
- @title = 'Deutsche Bank'
143
- soap_action = request.env['HTTP_SOAPACTION']
144
- return 500, 'Not valid SOAP' unless soap_action
145
- request_body = request.body
146
- doc = Nokogiri::XML(request_body)
147
- soap_action = soap_action.strip # Used in ERB
148
- blz_element = doc.at_xpath('//tns:blz')
149
- return 500, error_response_template unless blz_element
150
- @bank_name = blz_element.inner_text
151
- @bank_id = @bank_name.to_i
152
- return 500, ERB.new(bank_not_found).result(binding) if @bank_id.zero?
153
- @title = 'DAB Bank' if @bank_id == 500
154
- @multiple_ort = (@bank_id == 20)
155
- ERB.new(success_response_template).result(binding)
156
- end
157
-
158
- end
159
- end
160
- end
1
+
2
+ require 'erb'
3
+
4
+ module Soaspec
5
+ module TestServer
6
+ # Representing a GetBank SOAP service
7
+ class GetBank
8
+
9
+ class << self
10
+
11
+ def test_wsdl
12
+ ERB.new(File.read(File.join(File.dirname(__FILE__), 'bank.wsdl'))).result(binding)
13
+ end
14
+
15
+ def success_response_template
16
+ <<-EOF
17
+ <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
18
+ <soapenv:Body>
19
+ <ns1:getBankResponse xmlns:ns1="http://thomas-bayer.com/blz/">
20
+ <ns1:details unique_id="50">
21
+ <ns1:bezeichnung lang="German"><%= @title %></ns1:bezeichnung>
22
+ <ns1:bic>DEUTDEMMXXX <%= soap_action %></ns1:bic>
23
+ <ns1:ort>München</ns1:ort>
24
+ <% if @multiple_ort %>
25
+ <ns1:ort>Wellington</ns1:ort>
26
+ <ns1:ort>Tokyo</ns1:ort>
27
+ <% end %>
28
+ <ns1:plz><%= @bank_name %></ns1:plz>
29
+ </ns1:details>
30
+ </ns1:getBankResponse>
31
+ </soapenv:Body>
32
+ </soapenv:Envelope>
33
+ EOF
34
+ end
35
+
36
+ def bank_not_found
37
+ <<-EOF
38
+ <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
39
+ <soapenv:Body>
40
+ <soapenv:Fault>
41
+ <soapenv:Code>
42
+ <soapenv:Value>soapenv:Receiver</soapenv:Value>
43
+ </soapenv:Code>
44
+ <soapenv:Reason>
45
+ <soapenv:Text xml:lang="en-US">Keine Bank zur BLZ <%= @bank_name %> gefunden!</soapenv:Text>
46
+ </soapenv:Reason>
47
+ <soapenv:Detail>
48
+ <Exception>org.apache.axis2.AxisFault: Keine Bank zur BLZ test string gefunden!
49
+ at com.thomas_bayer.blz.BLZService.getBank(BLZService.java:41)
50
+ at com.thomas_bayer.blz.BLZServiceMessageReceiverInOut.invokeBusinessLogic(BLZServiceMessageReceiverInOut.java:49)
51
+ at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(AbstractInOutSyncMessageReceiver.java:42)
52
+ at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:96)
53
+ at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
54
+ at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
55
+ at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:120)
56
+ at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
57
+ at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
58
+ at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
59
+ at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
60
+ at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
61
+ at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
62
+ at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
63
+ at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
64
+ at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
65
+ at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
66
+ at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
67
+ at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:683)
68
+ at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
69
+ at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
70
+ at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
71
+ at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
72
+ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
73
+ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
74
+ at java.lang.Thread.run(Thread.java:745)
75
+ </Exception>
76
+ </soapenv:Detail>
77
+ </soapenv:Fault>
78
+ </soapenv:Body>
79
+ </soapenv:Envelope>
80
+ EOF
81
+ end
82
+
83
+ def error_response_template
84
+ <<-EOF
85
+ <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
86
+ <soapenv:Body>
87
+ <soapenv:Fault>
88
+ <soapenv:Code>
89
+ <soapenv:Value>soapenv:Receiver</soapenv:Value>
90
+ </soapenv:Code>
91
+ <soapenv:Reason>
92
+ <soapenv:Text xml:lang="en-US">org.apache.axis2.databinding.ADBException: Unexpected subelement getBank</soapenv:Text>
93
+ </soapenv:Reason>
94
+ <soapenv:Detail>
95
+ <Exception>org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement getBank
96
+ at org.apache.axis2.AxisFault.makeFault(AxisFault.java:417)
97
+ at com.thomas_bayer.blz.BLZServiceMessageReceiverInOut.fromOM(BLZServiceMessageReceiverInOut.java:124)
98
+ at com.thomas_bayer.blz.BLZServiceMessageReceiverInOut.invokeBusinessLogic(BLZServiceMessageReceiverInOut.java:43)
99
+ at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(AbstractInOutSyncMessageReceiver.java:42)
100
+ at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:96)
101
+ at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
102
+ at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
103
+ at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:120)
104
+ at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
105
+ at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
106
+ at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
107
+ at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
108
+ at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
109
+ at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
110
+ at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
111
+ at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
112
+ at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
113
+ at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
114
+ at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
115
+ at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:683)
116
+ at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
117
+ at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
118
+ at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
119
+ at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
120
+ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
121
+ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
122
+ at java.lang.Thread.run(Thread.java:745)
123
+ Caused by: java.lang.Exception: org.apache.axis2.databinding.ADBException: Unexpected subelement getBank
124
+ at com.thomas_bayer.adb.GetBankType$Factory.parse(GetBankType.java:423)
125
+ at com.thomas_bayer.adb.GetBank$Factory.parse(GetBank.java:304)
126
+ at com.thomas_bayer.blz.BLZServiceMessageReceiverInOut.fromOM(BLZServiceMessageReceiverInOut.java:117)
127
+ ... 25 more
128
+ Caused by: org.apache.axis2.databinding.ADBException: Unexpected subelement getBank
129
+ at com.thomas_bayer.adb.GetBankType$Factory.parse(GetBankType.java:410)
130
+ ... 27 more
131
+ </Exception>
132
+ </soapenv:Detail>
133
+ </soapenv:Fault>
134
+ </soapenv:Body>
135
+ </soapenv:Envelope>
136
+ EOF
137
+ end
138
+
139
+ # Return a response based upon the SOAP request
140
+ # @param [String] request XML in request
141
+ def response_for(request)
142
+ @title = 'Deutsche Bank'
143
+ soap_action = request.env['HTTP_SOAPACTION']
144
+ return 500, 'Not valid SOAP' unless soap_action
145
+ request_body = request.body
146
+ doc = Nokogiri::XML(request_body)
147
+ soap_action = soap_action.strip # Used in ERB
148
+ blz_element = doc.at_xpath('//tns:blz')
149
+ return 500, error_response_template unless blz_element
150
+ @bank_name = blz_element.inner_text
151
+ @bank_id = @bank_name.to_i
152
+ return 500, ERB.new(bank_not_found).result(binding) if @bank_id.zero?
153
+ @title = 'DAB Bank' if @bank_id == 500
154
+ @multiple_ort = (@bank_id == 20)
155
+ ERB.new(success_response_template).result(binding)
156
+ end
157
+
158
+ end
159
+ end
160
+ end
161
161
  end
@@ -1,27 +1,27 @@
1
- module Soaspec
2
- module TestServer
3
- # Used to simulate requests requiring oauth authentication
4
- class Invoices
5
- @user_used = nil
6
-
7
- class << self
8
- attr_accessor :user_used
9
-
10
- def oauth_headers
11
- {
12
- 'Content-Type' => 'application/json;charset=UTF-8'
13
- }
14
- end
15
-
16
- def oauth_body
17
- {
18
- access_token: 'TEST_TOKENiIsImtpZCI6IlRFU1QifQ.AAAABBBBRfaWQiOiJhYWQ5MjY3SIMULATE_LARGE_TOKEN3MmM5OGQ5NGE2YTU5YSIsImV4cCI6MTUyNzU3MTY4Mywic2NvcGUiOltdfQ.3OmCdW7fLZMUST_BE_ABLE_TO_HANDLEgAGaJB0lFYyhaw',
19
- token_type: 'Bearer',
20
- expires_in: '86399'
21
- }
22
- end
23
-
24
- end
25
- end
26
- end
27
- end
1
+ module Soaspec
2
+ module TestServer
3
+ # Used to simulate requests requiring oauth authentication
4
+ class Invoices
5
+ @user_used = nil
6
+
7
+ class << self
8
+ attr_accessor :user_used
9
+
10
+ def oauth_headers
11
+ {
12
+ 'Content-Type' => 'application/json;charset=UTF-8'
13
+ }
14
+ end
15
+
16
+ def oauth_body
17
+ {
18
+ access_token: 'TEST_TOKENiIsImtpZCI6IlRFU1QifQ.AAAABBBBRfaWQiOiJhYWQ5MjY3SIMULATE_LARGE_TOKEN3MmM5OGQ5NGE2YTU5YSIsImV4cCI6MTUyNzU3MTY4Mywic2NvcGUiOltdfQ.3OmCdW7fLZMUST_BE_ABLE_TO_HANDLEgAGaJB0lFYyhaw',
19
+ token_type: 'Bearer',
20
+ expires_in: '86399'
21
+ }
22
+ end
23
+
24
+ end
25
+ end
26
+ end
27
+ end
@@ -1,15 +1,15 @@
1
- <root>
2
- <h:table xmlns:h="http://www.w3.org/TR/html4/">
3
- <h:tr>
4
- <h:td>Apples</h:td>
5
- <h:td>Bananas</h:td>
6
- </h:tr>
7
- </h:table>
8
-
9
- <f:table xmlns:f="https://www.w3schools.com/furniture">
10
- <f:td>Wood</f:td>
11
- <f:name>African Coffee Table</f:name>
12
- <f:width>80</f:width>
13
- <f:length>120</f:length>
14
- </f:table>
1
+ <root>
2
+ <h:table xmlns:h="http://www.w3.org/TR/html4/">
3
+ <h:tr>
4
+ <h:td>Apples</h:td>
5
+ <h:td>Bananas</h:td>
6
+ </h:tr>
7
+ </h:table>
8
+
9
+ <f:table xmlns:f="https://www.w3schools.com/furniture">
10
+ <f:td>Wood</f:td>
11
+ <f:name>African Coffee Table</f:name>
12
+ <f:width>80</f:width>
13
+ <f:length>120</f:length>
14
+ </f:table>
15
15
  </root>
@@ -1,6 +1,6 @@
1
- <note date="2008-01-10">
2
- <to>Tove</to>
3
- <from>Jani</from>
4
- <comment_line>First comment</comment_line>
5
- <comment_line>Second comment</comment_line>
1
+ <note date="2008-01-10">
2
+ <to>Tove</to>
3
+ <from>Jani</from>
4
+ <comment_line>First comment</comment_line>
5
+ <comment_line>Second comment</comment_line>
6
6
  </note>
@@ -1,20 +1,20 @@
1
- module Soaspec
2
- module TestServer
3
- # Simulates ordering a new puppy. Used for testing REST storing, retrieving and updating data
4
- class PuppyService
5
- @data = {}
6
- @current_id = 1
7
- class << self
8
- attr_accessor :data
9
-
10
- def new_id
11
- @data[@current_id] = {}
12
- @data[@current_id][:Id] = @current_id
13
- @current_id += 1
14
- @current_id - 1
15
- end
16
-
17
- end
18
- end
19
- end
20
- end
1
+ module Soaspec
2
+ module TestServer
3
+ # Simulates ordering a new puppy. Used for testing REST storing, retrieving and updating data
4
+ class PuppyService
5
+ @data = {}
6
+ @current_id = 1
7
+ class << self
8
+ attr_accessor :data
9
+
10
+ def new_id
11
+ @data[@current_id] = {}
12
+ @data[@current_id][:Id] = @current_id
13
+ @current_id += 1
14
+ @current_id - 1
15
+ end
16
+
17
+ end
18
+ end
19
+ end
20
+ end