soaspec 0.2.23 → 0.2.24
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.
- checksums.yaml +4 -4
- data/.gitignore +15 -15
- data/.gitlab-ci.yml +33 -33
- data/.rspec +3 -3
- data/.rubocop.yml +2 -2
- data/CODE_OF_CONDUCT.md +74 -74
- data/ChangeLog +577 -573
- data/Gemfile +6 -6
- data/LICENSE.txt +21 -21
- data/README.md +230 -230
- data/Rakefile +42 -42
- data/Todo.md +15 -15
- data/exe/soaspec +123 -123
- data/exe/xml_to_yaml_file +42 -42
- data/lib/soaspec.rb +101 -101
- data/lib/soaspec/core_ext/hash.rb +35 -35
- data/lib/soaspec/cucumber/generic_steps.rb +85 -85
- data/lib/soaspec/demo.rb +4 -4
- data/lib/soaspec/exchange/exchange.rb +111 -111
- data/lib/soaspec/exchange/exchange_extractor.rb +83 -83
- data/lib/soaspec/exchange/exchange_properties.rb +26 -26
- data/lib/soaspec/exchange/exchange_repeater.rb +19 -19
- data/lib/soaspec/exchange/request_builder.rb +68 -68
- data/lib/soaspec/exchange/variable_storer.rb +22 -22
- data/lib/soaspec/exchange_handlers/exchange_handler.rb +126 -126
- data/lib/soaspec/exchange_handlers/handler_accessors.rb +130 -130
- data/lib/soaspec/exchange_handlers/response_extractor.rb +82 -82
- data/lib/soaspec/exchange_handlers/rest_exchanger_factory.rb +109 -109
- data/lib/soaspec/exchange_handlers/rest_handler.rb +259 -259
- data/lib/soaspec/exchange_handlers/rest_methods.rb +44 -44
- data/lib/soaspec/exchange_handlers/rest_parameters.rb +86 -86
- data/lib/soaspec/exchange_handlers/rest_parameters_defaults.rb +21 -21
- data/lib/soaspec/exchange_handlers/soap_handler.rb +235 -235
- data/lib/soaspec/exe_helpers.rb +92 -92
- data/lib/soaspec/generate_server.rb +37 -37
- 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/generate_exchange.html.erb +35 -35
- 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 +51 -51
- 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 +7 -7
- data/lib/soaspec/interpreter.rb +39 -39
- data/lib/soaspec/matchers.rb +114 -114
- data/lib/soaspec/not_found_errors.rb +13 -13
- data/lib/soaspec/o_auth2.rb +128 -128
- data/lib/soaspec/soaspec_shared_examples.rb +24 -24
- data/lib/soaspec/spec_logger.rb +121 -121
- data/lib/soaspec/template_reader.rb +28 -28
- data/lib/soaspec/test_server/bank.wsdl +90 -90
- data/lib/soaspec/test_server/get_bank.rb +164 -164
- data/lib/soaspec/test_server/id_manager.rb +39 -39
- 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 +19 -19
- data/lib/soaspec/test_server/test_attribute.rb +12 -12
- data/lib/soaspec/test_server/test_namespace.rb +12 -12
- data/lib/soaspec/version.rb +4 -3
- data/lib/soaspec/virtual_server.rb +174 -174
- data/lib/soaspec/wait.rb +41 -41
- data/lib/soaspec/wsdl_generator.rb +215 -215
- data/soaspec.gemspec +53 -53
- data/test.wsdl +116 -116
- data/test.xml +10 -10
- data/test_wsdl.rb +41 -41
- metadata +3 -4
@@ -1,164 +1,164 @@
|
|
1
|
-
require 'erb'
|
2
|
-
|
3
|
-
module Soaspec
|
4
|
-
module TestServer
|
5
|
-
# Representing a GetBank SOAP service
|
6
|
-
class GetBank
|
7
|
-
class << self
|
8
|
-
# This is retrieved by Savon
|
9
|
-
# @return [String] WSDL of mock web service
|
10
|
-
def test_wsdl
|
11
|
-
ERB.new(File.read(File.join(File.dirname(__FILE__), 'bank.wsdl'))).result(binding)
|
12
|
-
end
|
13
|
-
|
14
|
-
# @return [String] XML of success SOAP Response
|
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
|
-
# @return [String] XML of failure SOAP Response simulating bank not found
|
37
|
-
def bank_not_found
|
38
|
-
<<-EOF
|
39
|
-
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
|
40
|
-
<soapenv:Body>
|
41
|
-
<soapenv:Fault>
|
42
|
-
<soapenv:Code>
|
43
|
-
<soapenv:Value>soapenv:Receiver</soapenv:Value>
|
44
|
-
</soapenv:Code>
|
45
|
-
<soapenv:Reason>
|
46
|
-
<soapenv:Text xml:lang="en-US">Keine Bank zur BLZ <%= @bank_name %> gefunden!</soapenv:Text>
|
47
|
-
</soapenv:Reason>
|
48
|
-
<soapenv:Detail>
|
49
|
-
<Exception>org.apache.axis2.AxisFault: Keine Bank zur BLZ test string gefunden!
|
50
|
-
at com.thomas_bayer.blz.BLZService.getBank(BLZService.java:41)
|
51
|
-
at com.thomas_bayer.blz.BLZServiceMessageReceiverInOut.invokeBusinessLogic(BLZServiceMessageReceiverInOut.java:49)
|
52
|
-
at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(AbstractInOutSyncMessageReceiver.java:42)
|
53
|
-
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:96)
|
54
|
-
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
|
55
|
-
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
|
56
|
-
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:120)
|
57
|
-
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
|
58
|
-
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
|
59
|
-
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
|
60
|
-
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
|
61
|
-
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
|
62
|
-
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
|
63
|
-
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
|
64
|
-
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
|
65
|
-
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
|
66
|
-
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
|
67
|
-
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
|
68
|
-
at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:683)
|
69
|
-
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
|
70
|
-
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
|
71
|
-
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
|
72
|
-
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
|
73
|
-
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
|
74
|
-
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
|
75
|
-
at java.lang.Thread.run(Thread.java:745)
|
76
|
-
</Exception>
|
77
|
-
</soapenv:Detail>
|
78
|
-
</soapenv:Fault>
|
79
|
-
</soapenv:Body>
|
80
|
-
</soapenv:Envelope>
|
81
|
-
EOF
|
82
|
-
end
|
83
|
-
|
84
|
-
def error_response_template
|
85
|
-
<<-EOF
|
86
|
-
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
|
87
|
-
<soapenv:Body>
|
88
|
-
<soapenv:Fault>
|
89
|
-
<soapenv:Code>
|
90
|
-
<soapenv:Value>soapenv:Receiver</soapenv:Value>
|
91
|
-
</soapenv:Code>
|
92
|
-
<soapenv:Reason>
|
93
|
-
<soapenv:Text xml:lang="en-US">org.apache.axis2.databinding.ADBException: Unexpected subelement getBank</soapenv:Text>
|
94
|
-
</soapenv:Reason>
|
95
|
-
<soapenv:Detail>
|
96
|
-
<Exception>org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement getBank
|
97
|
-
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:417)
|
98
|
-
at com.thomas_bayer.blz.BLZServiceMessageReceiverInOut.fromOM(BLZServiceMessageReceiverInOut.java:124)
|
99
|
-
at com.thomas_bayer.blz.BLZServiceMessageReceiverInOut.invokeBusinessLogic(BLZServiceMessageReceiverInOut.java:43)
|
100
|
-
at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(AbstractInOutSyncMessageReceiver.java:42)
|
101
|
-
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:96)
|
102
|
-
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
|
103
|
-
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
|
104
|
-
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:120)
|
105
|
-
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
|
106
|
-
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
|
107
|
-
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
|
108
|
-
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
|
109
|
-
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
|
110
|
-
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
|
111
|
-
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
|
112
|
-
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
|
113
|
-
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
|
114
|
-
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
|
115
|
-
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
|
116
|
-
at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:683)
|
117
|
-
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
|
118
|
-
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
|
119
|
-
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
|
120
|
-
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
|
121
|
-
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
|
122
|
-
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
|
123
|
-
at java.lang.Thread.run(Thread.java:745)
|
124
|
-
Caused by: java.lang.Exception: org.apache.axis2.databinding.ADBException: Unexpected subelement getBank
|
125
|
-
at com.thomas_bayer.adb.GetBankType$Factory.parse(GetBankType.java:423)
|
126
|
-
at com.thomas_bayer.adb.GetBank$Factory.parse(GetBank.java:304)
|
127
|
-
at com.thomas_bayer.blz.BLZServiceMessageReceiverInOut.fromOM(BLZServiceMessageReceiverInOut.java:117)
|
128
|
-
... 25 more
|
129
|
-
Caused by: org.apache.axis2.databinding.ADBException: Unexpected subelement getBank
|
130
|
-
at com.thomas_bayer.adb.GetBankType$Factory.parse(GetBankType.java:410)
|
131
|
-
... 27 more
|
132
|
-
</Exception>
|
133
|
-
</soapenv:Detail>
|
134
|
-
</soapenv:Fault>
|
135
|
-
</soapenv:Body>
|
136
|
-
</soapenv:Envelope>
|
137
|
-
EOF
|
138
|
-
end
|
139
|
-
|
140
|
-
# Return a response based upon the SOAP request
|
141
|
-
# @param [String] request XML in request
|
142
|
-
def response_for(request)
|
143
|
-
@title = 'Deutsche Bank'
|
144
|
-
soap_action = request.env['HTTP_SOAPACTION']
|
145
|
-
return 500, 'Not valid SOAP' unless soap_action
|
146
|
-
|
147
|
-
request_body = request.body
|
148
|
-
doc = Nokogiri::XML(request_body)
|
149
|
-
soap_action = soap_action.strip # Used in ERB
|
150
|
-
blz_element = doc.at_xpath('//tns:blz')
|
151
|
-
return 500, error_response_template unless blz_element
|
152
|
-
|
153
|
-
@bank_name = blz_element.inner_text
|
154
|
-
@bank_id = @bank_name.to_i
|
155
|
-
return 500, ERB.new(bank_not_found).result(binding) if @bank_id.zero?
|
156
|
-
|
157
|
-
@title = 'DAB Bank' if @bank_id == 500
|
158
|
-
@multiple_ort = (@bank_id == 20)
|
159
|
-
ERB.new(success_response_template).result(binding)
|
160
|
-
end
|
161
|
-
end
|
162
|
-
end
|
163
|
-
end
|
164
|
-
end
|
1
|
+
require 'erb'
|
2
|
+
|
3
|
+
module Soaspec
|
4
|
+
module TestServer
|
5
|
+
# Representing a GetBank SOAP service
|
6
|
+
class GetBank
|
7
|
+
class << self
|
8
|
+
# This is retrieved by Savon
|
9
|
+
# @return [String] WSDL of mock web service
|
10
|
+
def test_wsdl
|
11
|
+
ERB.new(File.read(File.join(File.dirname(__FILE__), 'bank.wsdl'))).result(binding)
|
12
|
+
end
|
13
|
+
|
14
|
+
# @return [String] XML of success SOAP Response
|
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
|
+
# @return [String] XML of failure SOAP Response simulating bank not found
|
37
|
+
def bank_not_found
|
38
|
+
<<-EOF
|
39
|
+
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
|
40
|
+
<soapenv:Body>
|
41
|
+
<soapenv:Fault>
|
42
|
+
<soapenv:Code>
|
43
|
+
<soapenv:Value>soapenv:Receiver</soapenv:Value>
|
44
|
+
</soapenv:Code>
|
45
|
+
<soapenv:Reason>
|
46
|
+
<soapenv:Text xml:lang="en-US">Keine Bank zur BLZ <%= @bank_name %> gefunden!</soapenv:Text>
|
47
|
+
</soapenv:Reason>
|
48
|
+
<soapenv:Detail>
|
49
|
+
<Exception>org.apache.axis2.AxisFault: Keine Bank zur BLZ test string gefunden!
|
50
|
+
at com.thomas_bayer.blz.BLZService.getBank(BLZService.java:41)
|
51
|
+
at com.thomas_bayer.blz.BLZServiceMessageReceiverInOut.invokeBusinessLogic(BLZServiceMessageReceiverInOut.java:49)
|
52
|
+
at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(AbstractInOutSyncMessageReceiver.java:42)
|
53
|
+
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:96)
|
54
|
+
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
|
55
|
+
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
|
56
|
+
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:120)
|
57
|
+
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
|
58
|
+
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
|
59
|
+
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
|
60
|
+
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
|
61
|
+
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
|
62
|
+
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
|
63
|
+
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
|
64
|
+
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
|
65
|
+
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
|
66
|
+
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
|
67
|
+
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
|
68
|
+
at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:683)
|
69
|
+
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
|
70
|
+
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
|
71
|
+
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
|
72
|
+
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
|
73
|
+
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
|
74
|
+
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
|
75
|
+
at java.lang.Thread.run(Thread.java:745)
|
76
|
+
</Exception>
|
77
|
+
</soapenv:Detail>
|
78
|
+
</soapenv:Fault>
|
79
|
+
</soapenv:Body>
|
80
|
+
</soapenv:Envelope>
|
81
|
+
EOF
|
82
|
+
end
|
83
|
+
|
84
|
+
def error_response_template
|
85
|
+
<<-EOF
|
86
|
+
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
|
87
|
+
<soapenv:Body>
|
88
|
+
<soapenv:Fault>
|
89
|
+
<soapenv:Code>
|
90
|
+
<soapenv:Value>soapenv:Receiver</soapenv:Value>
|
91
|
+
</soapenv:Code>
|
92
|
+
<soapenv:Reason>
|
93
|
+
<soapenv:Text xml:lang="en-US">org.apache.axis2.databinding.ADBException: Unexpected subelement getBank</soapenv:Text>
|
94
|
+
</soapenv:Reason>
|
95
|
+
<soapenv:Detail>
|
96
|
+
<Exception>org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement getBank
|
97
|
+
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:417)
|
98
|
+
at com.thomas_bayer.blz.BLZServiceMessageReceiverInOut.fromOM(BLZServiceMessageReceiverInOut.java:124)
|
99
|
+
at com.thomas_bayer.blz.BLZServiceMessageReceiverInOut.invokeBusinessLogic(BLZServiceMessageReceiverInOut.java:43)
|
100
|
+
at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(AbstractInOutSyncMessageReceiver.java:42)
|
101
|
+
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:96)
|
102
|
+
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
|
103
|
+
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
|
104
|
+
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:120)
|
105
|
+
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
|
106
|
+
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
|
107
|
+
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
|
108
|
+
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
|
109
|
+
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
|
110
|
+
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
|
111
|
+
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
|
112
|
+
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
|
113
|
+
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
|
114
|
+
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
|
115
|
+
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
|
116
|
+
at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:683)
|
117
|
+
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
|
118
|
+
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
|
119
|
+
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
|
120
|
+
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
|
121
|
+
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
|
122
|
+
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
|
123
|
+
at java.lang.Thread.run(Thread.java:745)
|
124
|
+
Caused by: java.lang.Exception: org.apache.axis2.databinding.ADBException: Unexpected subelement getBank
|
125
|
+
at com.thomas_bayer.adb.GetBankType$Factory.parse(GetBankType.java:423)
|
126
|
+
at com.thomas_bayer.adb.GetBank$Factory.parse(GetBank.java:304)
|
127
|
+
at com.thomas_bayer.blz.BLZServiceMessageReceiverInOut.fromOM(BLZServiceMessageReceiverInOut.java:117)
|
128
|
+
... 25 more
|
129
|
+
Caused by: org.apache.axis2.databinding.ADBException: Unexpected subelement getBank
|
130
|
+
at com.thomas_bayer.adb.GetBankType$Factory.parse(GetBankType.java:410)
|
131
|
+
... 27 more
|
132
|
+
</Exception>
|
133
|
+
</soapenv:Detail>
|
134
|
+
</soapenv:Fault>
|
135
|
+
</soapenv:Body>
|
136
|
+
</soapenv:Envelope>
|
137
|
+
EOF
|
138
|
+
end
|
139
|
+
|
140
|
+
# Return a response based upon the SOAP request
|
141
|
+
# @param [String] request XML in request
|
142
|
+
def response_for(request)
|
143
|
+
@title = 'Deutsche Bank'
|
144
|
+
soap_action = request.env['HTTP_SOAPACTION']
|
145
|
+
return 500, 'Not valid SOAP' unless soap_action
|
146
|
+
|
147
|
+
request_body = request.body
|
148
|
+
doc = Nokogiri::XML(request_body)
|
149
|
+
soap_action = soap_action.strip # Used in ERB
|
150
|
+
blz_element = doc.at_xpath('//tns:blz')
|
151
|
+
return 500, error_response_template unless blz_element
|
152
|
+
|
153
|
+
@bank_name = blz_element.inner_text
|
154
|
+
@bank_id = @bank_name.to_i
|
155
|
+
return 500, ERB.new(bank_not_found).result(binding) if @bank_id.zero?
|
156
|
+
|
157
|
+
@title = 'DAB Bank' if @bank_id == 500
|
158
|
+
@multiple_ort = (@bank_id == 20)
|
159
|
+
ERB.new(success_response_template).result(binding)
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
@@ -1,39 +1,39 @@
|
|
1
|
-
module Soaspec
|
2
|
-
module TestServer
|
3
|
-
# Handles returning ids dependent on a number of factors
|
4
|
-
# Made to demonstrate creating testing a list of ids where a few return false
|
5
|
-
# when not developed and checking each value in the list can find the false value
|
6
|
-
class IdManager
|
7
|
-
# @return [Boolean] Whether to simulate a fully developed state where everything is done
|
8
|
-
@developed = false
|
9
|
-
class << self
|
10
|
-
attr_accessor :developed
|
11
|
-
|
12
|
-
# Once developed is set, everything will return true. A 'false' value represents something
|
13
|
-
# not developed
|
14
|
-
# @param [String] num Number representing tester or test number
|
15
|
-
# @param [String] id Id used in test
|
16
|
-
# @return Result depending on num, id and whether '@developed' is set
|
17
|
-
def result_for(num, id)
|
18
|
-
result = undeveloped_id(num, id) unless @developed
|
19
|
-
result || 'true'
|
20
|
-
end
|
21
|
-
|
22
|
-
# Idea is that this will return false for a particular id for different test numbers
|
23
|
-
# @param [String] num Number representing tester or test number
|
24
|
-
# @param [String] id Id used in test
|
25
|
-
# @return [String] true of false depending on num and id
|
26
|
-
def undeveloped_id(num, id)
|
27
|
-
case num
|
28
|
-
when '1', '4', '10' then 'false' if id == '40'
|
29
|
-
when '3', '11', '9' then 'false' if id == '74'
|
30
|
-
when '2', '6', '8' then 'false' if id == '80'
|
31
|
-
when '7', '5', '12' then 'false' if id == '64'
|
32
|
-
else
|
33
|
-
'true'
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
1
|
+
module Soaspec
|
2
|
+
module TestServer
|
3
|
+
# Handles returning ids dependent on a number of factors
|
4
|
+
# Made to demonstrate creating testing a list of ids where a few return false
|
5
|
+
# when not developed and checking each value in the list can find the false value
|
6
|
+
class IdManager
|
7
|
+
# @return [Boolean] Whether to simulate a fully developed state where everything is done
|
8
|
+
@developed = false
|
9
|
+
class << self
|
10
|
+
attr_accessor :developed
|
11
|
+
|
12
|
+
# Once developed is set, everything will return true. A 'false' value represents something
|
13
|
+
# not developed
|
14
|
+
# @param [String] num Number representing tester or test number
|
15
|
+
# @param [String] id Id used in test
|
16
|
+
# @return Result depending on num, id and whether '@developed' is set
|
17
|
+
def result_for(num, id)
|
18
|
+
result = undeveloped_id(num, id) unless @developed
|
19
|
+
result || 'true'
|
20
|
+
end
|
21
|
+
|
22
|
+
# Idea is that this will return false for a particular id for different test numbers
|
23
|
+
# @param [String] num Number representing tester or test number
|
24
|
+
# @param [String] id Id used in test
|
25
|
+
# @return [String] true of false depending on num and id
|
26
|
+
def undeveloped_id(num, id)
|
27
|
+
case num
|
28
|
+
when '1', '4', '10' then 'false' if id == '40'
|
29
|
+
when '3', '11', '9' then 'false' if id == '74'
|
30
|
+
when '2', '6', '8' then 'false' if id == '80'
|
31
|
+
when '7', '5', '12' then 'false' if id == '64'
|
32
|
+
else
|
33
|
+
'true'
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
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
|
-
instance_url: %w[http://this_is_my_instance http://this_is_second_instance].sample
|
22
|
-
}
|
23
|
-
end
|
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
|
+
instance_url: %w[http://this_is_my_instance http://this_is_second_instance].sample
|
22
|
+
}
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|