soaspec 0.0.54 → 0.0.55
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/ChangeLog +4 -0
- data/Gemfile.lock +1 -1
- data/Rakefile +2 -1
- data/config/data/default.yml +3 -3
- data/exe/soaspec-virtual-server +53 -0
- data/lib/soaspec.rb +3 -0
- data/lib/soaspec/core_ext/hash.rb +3 -1
- data/lib/soaspec/test_server/bank.wsdl +91 -0
- data/lib/soaspec/test_server/get_bank.rb +155 -0
- data/lib/soaspec/test_server/note.xml +4 -0
- data/lib/soaspec/test_server/puppy_service.rb +10 -0
- data/lib/soaspec/test_server/test_attribute.rb +13 -0
- data/lib/soaspec/version.rb +1 -1
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e30d17380c5f1c56d221e8bfe691cb49cfbbff4f
|
4
|
+
data.tar.gz: dbebcc5454dd41d839084df03e35be3910c0cdfd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 101c8c3aa9fa6c9fd67fb99b83b0ff5fd48b4f61c1f3702fab7fa11011efa6bc7a769acfb18ad5479a6604d242a0f08a909d3b653116dc061e96a470b5421af6
|
7
|
+
data.tar.gz: b1576e4284c9e92a61effd56f3aa8da325c61ac5170e8da24a2e8526436e39b46786be0acf01269570ac5e785a3c24690e5dab981145299751d54c67a6b4e195
|
data/ChangeLog
CHANGED
data/Gemfile.lock
CHANGED
data/Rakefile
CHANGED
@@ -33,6 +33,7 @@ CLOBBER.include 'logs/*'
|
|
33
33
|
|
34
34
|
desc 'Start virtual web service'
|
35
35
|
task :start_test_server do
|
36
|
-
ENV['test_server_pid'] = Process.spawn('ruby', '
|
36
|
+
ENV['test_server_pid'] = Process.spawn('ruby', 'exe/soaspec-virtual-server', err: %w[logs/test_server.log w]).to_s
|
37
|
+
sleep 1 # Wait a little for virtual server to start up
|
37
38
|
puts 'Running test server at pid ' + ENV['test_server_pid']
|
38
39
|
end
|
data/config/data/default.yml
CHANGED
@@ -0,0 +1,53 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# Used to run virtual web service on localhost. This makes tests more reliable and faster
|
4
|
+
|
5
|
+
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
|
6
|
+
require 'soaspec'
|
7
|
+
require 'sinatra'
|
8
|
+
require 'nokogiri'
|
9
|
+
require 'erb'
|
10
|
+
require 'json'
|
11
|
+
require 'faker'
|
12
|
+
|
13
|
+
set :port, 4999
|
14
|
+
|
15
|
+
# Used to test attributes
|
16
|
+
get '/test_attribute' do
|
17
|
+
Soaspec::TestServer::TestAttribute.note
|
18
|
+
end
|
19
|
+
|
20
|
+
# This is the one being hit by SOAP actions
|
21
|
+
post '/BLZService' do
|
22
|
+
Soaspec::TestServer::GetBank.response_for request
|
23
|
+
end
|
24
|
+
|
25
|
+
# This is returned when a query for the WSDL is made
|
26
|
+
get '/BLZService' do
|
27
|
+
[200, { 'Content-Type' => 'text/xml' }, Soaspec::TestServer::GetBank.test_wsdl]
|
28
|
+
end
|
29
|
+
|
30
|
+
# Used for testing storage of data
|
31
|
+
post '/test/id' do
|
32
|
+
# puts request.body.string
|
33
|
+
request_hash = JSON.parse(request.body.string)
|
34
|
+
# request_hash = JSON.parse('{ "id": "1" }')
|
35
|
+
# puts request_hash
|
36
|
+
uuid = SecureRandom.uuid
|
37
|
+
Soaspec::TestServer::PuppyService.data[uuid] = {}
|
38
|
+
Soaspec::TestServer::PuppyService.data[uuid][:id] = request_hash['id']
|
39
|
+
# puts PuppyService.data
|
40
|
+
'Success'
|
41
|
+
end
|
42
|
+
|
43
|
+
# Used for testing retrieving storage of data
|
44
|
+
get '/test/id/:id' do |id|
|
45
|
+
# puts "ID is:#{id}:"
|
46
|
+
# puts id.class
|
47
|
+
# puts PuppyService.data
|
48
|
+
# puts PuppyService.data['id']
|
49
|
+
# puts PuppyService.data[id]
|
50
|
+
result = Soaspec::TestServer::PuppyService.data.select { |_key, hash| hash[:id] == id }
|
51
|
+
|
52
|
+
JSON.generate(result)
|
53
|
+
end
|
data/lib/soaspec.rb
CHANGED
@@ -22,6 +22,9 @@ require 'soaspec/exchange_handlers/rest_handler'
|
|
22
22
|
require 'soaspec/exchange_handlers/handler_accessors'
|
23
23
|
require 'soaspec/interpreter'
|
24
24
|
require 'soaspec/not_found_errors'
|
25
|
+
require 'soaspec/test_server/get_bank'
|
26
|
+
require 'soaspec/test_server/test_attribute'
|
27
|
+
require 'soaspec/test_server/puppy_service'
|
25
28
|
|
26
29
|
# Gem for handling SOAP and REST api tests
|
27
30
|
module Soaspec
|
@@ -4,6 +4,7 @@
|
|
4
4
|
# Override Hash class with convience methods
|
5
5
|
class Hash
|
6
6
|
|
7
|
+
# Transform each key in Hash to a symbol. Privately used by non-self method
|
7
8
|
def self.transform_keys_to_symbols(value)
|
8
9
|
return value if not value.is_a?(Hash)
|
9
10
|
hash = value.inject({}){|memo,(k,v)| memo[k.to_sym] = Hash.transform_keys_to_symbols(v); memo}
|
@@ -15,6 +16,7 @@ class Hash
|
|
15
16
|
inject({}){|memo, (k, v)| memo[k.to_sym] = Hash.transform_keys_to_symbols(v); memo}
|
16
17
|
end
|
17
18
|
|
19
|
+
# Returns all keys that have a particular value within a nested Hash
|
18
20
|
def find_all_values_for(key)
|
19
21
|
result = []
|
20
22
|
result << self[key]
|
@@ -58,7 +60,7 @@ class Hash
|
|
58
60
|
end
|
59
61
|
|
60
62
|
# Loop through each item within a key within a Hash if the key exists
|
61
|
-
# @param [Key] Key within hash to iterate through
|
63
|
+
# @param [Key] key Key within hash to iterate through
|
62
64
|
def each_if_not_null(key)
|
63
65
|
case key.class.to_s
|
64
66
|
when 'String'
|
@@ -0,0 +1,91 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:tns="http://thomas-bayer.com/blz/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://thomas-bayer.com/blz/">
|
3
|
+
<wsdl:documentation>BLZService</wsdl:documentation>
|
4
|
+
<wsdl:types>
|
5
|
+
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://thomas-bayer.com/blz/">
|
6
|
+
<xsd:element name="getBank" type="tns:getBankType"/>
|
7
|
+
<xsd:element name="getBankResponse" type="tns:getBankResponseType"/>
|
8
|
+
<xsd:complexType name="getBankType">
|
9
|
+
<xsd:sequence>
|
10
|
+
<xsd:element name="blz" type="xsd:string"/>
|
11
|
+
</xsd:sequence>
|
12
|
+
</xsd:complexType>
|
13
|
+
<xsd:complexType name="getBankResponseType">
|
14
|
+
<xsd:sequence>
|
15
|
+
<xsd:element name="details" type="tns:detailsType"/>
|
16
|
+
</xsd:sequence>
|
17
|
+
</xsd:complexType>
|
18
|
+
<xsd:complexType name="detailsType">
|
19
|
+
<xsd:sequence>
|
20
|
+
<xsd:element minOccurs="0" name="bezeichnung" type="xsd:string"/>
|
21
|
+
<xsd:element minOccurs="0" name="bic" type="xsd:string"/>
|
22
|
+
<xsd:element minOccurs="0" name="ort" type="xsd:string"/>
|
23
|
+
<xsd:element minOccurs="0" name="plz" type="xsd:string"/>
|
24
|
+
</xsd:sequence>
|
25
|
+
</xsd:complexType>
|
26
|
+
</xsd:schema>
|
27
|
+
</wsdl:types>
|
28
|
+
<wsdl:message name="getBank">
|
29
|
+
<wsdl:part name="parameters" element="tns:getBank"/>
|
30
|
+
</wsdl:message>
|
31
|
+
<wsdl:message name="getBankResponse">
|
32
|
+
<wsdl:part name="parameters" element="tns:getBankResponse"/>
|
33
|
+
</wsdl:message>
|
34
|
+
<wsdl:portType name="BLZServicePortType">
|
35
|
+
<wsdl:operation name="getBank">
|
36
|
+
<wsdl:input message="tns:getBank"/>
|
37
|
+
<!--<wsdl:output message="tns:getBankResponse" wsaw:Action="http://thomas-bayer.com/blz/BLZService/getBankResponse"/>-->
|
38
|
+
<wsdl:output message="tns:getBankResponse" wsaw:Action="http://localhost:4567/BLZService/getBankResponse"/>
|
39
|
+
</wsdl:operation>
|
40
|
+
</wsdl:portType>
|
41
|
+
<wsdl:binding name="BLZServiceSOAP11Binding" type="tns:BLZServicePortType">
|
42
|
+
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
43
|
+
<wsdl:operation name="getBank">
|
44
|
+
<soap:operation style="document" soapAction=""/>
|
45
|
+
<wsdl:input>
|
46
|
+
<soap:body use="literal"/>
|
47
|
+
</wsdl:input>
|
48
|
+
<wsdl:output>
|
49
|
+
<soap:body use="literal"/>
|
50
|
+
</wsdl:output>
|
51
|
+
</wsdl:operation>
|
52
|
+
</wsdl:binding>
|
53
|
+
<wsdl:binding name="BLZServiceSOAP12Binding" type="tns:BLZServicePortType">
|
54
|
+
<soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
|
55
|
+
<wsdl:operation name="getBank">
|
56
|
+
<soap12:operation style="document" soapAction=""/>
|
57
|
+
<wsdl:input>
|
58
|
+
<soap12:body use="literal"/>
|
59
|
+
</wsdl:input>
|
60
|
+
<wsdl:output>
|
61
|
+
<soap12:body use="literal"/>
|
62
|
+
</wsdl:output>
|
63
|
+
</wsdl:operation>
|
64
|
+
</wsdl:binding>
|
65
|
+
<wsdl:binding name="BLZServiceHttpBinding" type="tns:BLZServicePortType">
|
66
|
+
<http:binding verb="POST"/>
|
67
|
+
<wsdl:operation name="getBank">
|
68
|
+
<http:operation location="BLZService/getBank"/>
|
69
|
+
<wsdl:input>
|
70
|
+
<mime:content part="getBank" type="text/xml"/>
|
71
|
+
</wsdl:input>
|
72
|
+
<wsdl:output>
|
73
|
+
<mime:content part="getBank" type="text/xml"/>
|
74
|
+
</wsdl:output>
|
75
|
+
</wsdl:operation>
|
76
|
+
</wsdl:binding>
|
77
|
+
<wsdl:service name="BLZService">
|
78
|
+
<wsdl:port name="BLZServiceSOAP11port_http" binding="tns:BLZServiceSOAP11Binding">
|
79
|
+
<!-- <soap:address location="http://www.thomas-bayer.com/axis2/services/BLZService"/> -->
|
80
|
+
<soap:address location="http://localhost:4999/BLZService"/>
|
81
|
+
</wsdl:port>
|
82
|
+
<wsdl:port name="BLZServiceSOAP12port_http" binding="tns:BLZServiceSOAP12Binding">
|
83
|
+
<!--<soap12:address location="http://www.thomas-bayer.com/axis2/services/BLZService"/>-->
|
84
|
+
<soap12:address location="http://localhost:4999/BLZService"/>
|
85
|
+
</wsdl:port>
|
86
|
+
<wsdl:port name="BLZServiceHttpport" binding="tns:BLZServiceHttpBinding">
|
87
|
+
<!--<http:address location="http://www.thomas-bayer.com/axis2/services/BLZService"/>-->
|
88
|
+
<soap:address location="http://localhost:4999/BLZService"/>
|
89
|
+
</wsdl:port>
|
90
|
+
</wsdl:service>
|
91
|
+
</wsdl:definitions>
|
@@ -0,0 +1,155 @@
|
|
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
|
+
<ns1:plz><%= @bank_name %></ns1:plz>
|
25
|
+
</ns1:details>
|
26
|
+
</ns1:getBankResponse>
|
27
|
+
</soapenv:Body>
|
28
|
+
</soapenv:Envelope>
|
29
|
+
EOF
|
30
|
+
end
|
31
|
+
|
32
|
+
def bank_not_found
|
33
|
+
<<-EOF
|
34
|
+
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
|
35
|
+
<soapenv:Body>
|
36
|
+
<soapenv:Fault>
|
37
|
+
<soapenv:Code>
|
38
|
+
<soapenv:Value>soapenv:Receiver</soapenv:Value>
|
39
|
+
</soapenv:Code>
|
40
|
+
<soapenv:Reason>
|
41
|
+
<soapenv:Text xml:lang="en-US">Keine Bank zur BLZ <%= @bank_name %> gefunden!</soapenv:Text>
|
42
|
+
</soapenv:Reason>
|
43
|
+
<soapenv:Detail>
|
44
|
+
<Exception>org.apache.axis2.AxisFault: Keine Bank zur BLZ test string gefunden!
|
45
|
+
at com.thomas_bayer.blz.BLZService.getBank(BLZService.java:41)
|
46
|
+
at com.thomas_bayer.blz.BLZServiceMessageReceiverInOut.invokeBusinessLogic(BLZServiceMessageReceiverInOut.java:49)
|
47
|
+
at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(AbstractInOutSyncMessageReceiver.java:42)
|
48
|
+
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:96)
|
49
|
+
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
|
50
|
+
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
|
51
|
+
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:120)
|
52
|
+
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
|
53
|
+
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
|
54
|
+
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
|
55
|
+
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
|
56
|
+
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
|
57
|
+
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
|
58
|
+
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
|
59
|
+
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
|
60
|
+
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
|
61
|
+
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
|
62
|
+
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
|
63
|
+
at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:683)
|
64
|
+
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
|
65
|
+
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
|
66
|
+
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
|
67
|
+
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
|
68
|
+
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
|
69
|
+
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
|
70
|
+
at java.lang.Thread.run(Thread.java:745)
|
71
|
+
</Exception>
|
72
|
+
</soapenv:Detail>
|
73
|
+
</soapenv:Fault>
|
74
|
+
</soapenv:Body>
|
75
|
+
</soapenv:Envelope>
|
76
|
+
EOF
|
77
|
+
end
|
78
|
+
|
79
|
+
def error_response_template
|
80
|
+
<<-EOF
|
81
|
+
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
|
82
|
+
<soapenv:Body>
|
83
|
+
<soapenv:Fault>
|
84
|
+
<soapenv:Code>
|
85
|
+
<soapenv:Value>soapenv:Receiver</soapenv:Value>
|
86
|
+
</soapenv:Code>
|
87
|
+
<soapenv:Reason>
|
88
|
+
<soapenv:Text xml:lang="en-US">org.apache.axis2.databinding.ADBException: Unexpected subelement getBank</soapenv:Text>
|
89
|
+
</soapenv:Reason>
|
90
|
+
<soapenv:Detail>
|
91
|
+
<Exception>org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement getBank
|
92
|
+
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:417)
|
93
|
+
at com.thomas_bayer.blz.BLZServiceMessageReceiverInOut.fromOM(BLZServiceMessageReceiverInOut.java:124)
|
94
|
+
at com.thomas_bayer.blz.BLZServiceMessageReceiverInOut.invokeBusinessLogic(BLZServiceMessageReceiverInOut.java:43)
|
95
|
+
at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(AbstractInOutSyncMessageReceiver.java:42)
|
96
|
+
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:96)
|
97
|
+
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
|
98
|
+
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
|
99
|
+
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:120)
|
100
|
+
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
|
101
|
+
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
|
102
|
+
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
|
103
|
+
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
|
104
|
+
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
|
105
|
+
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
|
106
|
+
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
|
107
|
+
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
|
108
|
+
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
|
109
|
+
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
|
110
|
+
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
|
111
|
+
at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:683)
|
112
|
+
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
|
113
|
+
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
|
114
|
+
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
|
115
|
+
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
|
116
|
+
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
|
117
|
+
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
|
118
|
+
at java.lang.Thread.run(Thread.java:745)
|
119
|
+
Caused by: java.lang.Exception: org.apache.axis2.databinding.ADBException: Unexpected subelement getBank
|
120
|
+
at com.thomas_bayer.adb.GetBankType$Factory.parse(GetBankType.java:423)
|
121
|
+
at com.thomas_bayer.adb.GetBank$Factory.parse(GetBank.java:304)
|
122
|
+
at com.thomas_bayer.blz.BLZServiceMessageReceiverInOut.fromOM(BLZServiceMessageReceiverInOut.java:117)
|
123
|
+
... 25 more
|
124
|
+
Caused by: org.apache.axis2.databinding.ADBException: Unexpected subelement getBank
|
125
|
+
at com.thomas_bayer.adb.GetBankType$Factory.parse(GetBankType.java:410)
|
126
|
+
... 27 more
|
127
|
+
</Exception>
|
128
|
+
</soapenv:Detail>
|
129
|
+
</soapenv:Fault>
|
130
|
+
</soapenv:Body>
|
131
|
+
</soapenv:Envelope>
|
132
|
+
EOF
|
133
|
+
end
|
134
|
+
|
135
|
+
# Return a response based upon the SOAP request
|
136
|
+
# @param [String] request XML in request
|
137
|
+
def response_for(request)
|
138
|
+
@title = 'Deutsche Bank'
|
139
|
+
soap_action = request.env['HTTP_SOAPACTION']
|
140
|
+
return 500, 'Not valid SOAP' unless soap_action
|
141
|
+
request_body = request.body
|
142
|
+
doc = Nokogiri::XML(request_body)
|
143
|
+
soap_action = soap_action.strip # Used in ERB
|
144
|
+
blz_element = doc.at_xpath('//tns:blz')
|
145
|
+
return 500, error_response_template unless blz_element
|
146
|
+
@bank_name = blz_element.inner_text
|
147
|
+
return 500, ERB.new(bank_not_found).result(binding) if @bank_name.to_i == 0
|
148
|
+
@title = 'DAB Bank' if @bank_id == '500'
|
149
|
+
ERB.new(success_response_template).result(binding)
|
150
|
+
end
|
151
|
+
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
data/lib/soaspec/version.rb
CHANGED
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.0.
|
4
|
+
version: 0.0.55
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SamuelGarrattIQA
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -143,6 +143,7 @@ email:
|
|
143
143
|
executables:
|
144
144
|
- soaspec-generate
|
145
145
|
- soaspec-init
|
146
|
+
- soaspec-virtual-server
|
146
147
|
- xml_to_yaml_file
|
147
148
|
extensions: []
|
148
149
|
extra_rdoc_files: []
|
@@ -165,6 +166,7 @@ files:
|
|
165
166
|
- config/data/default.yml
|
166
167
|
- exe/soaspec-generate
|
167
168
|
- exe/soaspec-init
|
169
|
+
- exe/soaspec-virtual-server
|
168
170
|
- exe/xml_to_yaml_file
|
169
171
|
- lib/soaspec.rb
|
170
172
|
- lib/soaspec/core_ext/hash.rb
|
@@ -180,6 +182,11 @@ files:
|
|
180
182
|
- lib/soaspec/not_found_errors.rb
|
181
183
|
- lib/soaspec/soaspec_shared_examples.rb
|
182
184
|
- lib/soaspec/spec_logger.rb
|
185
|
+
- lib/soaspec/test_server/bank.wsdl
|
186
|
+
- lib/soaspec/test_server/get_bank.rb
|
187
|
+
- lib/soaspec/test_server/note.xml
|
188
|
+
- lib/soaspec/test_server/puppy_service.rb
|
189
|
+
- lib/soaspec/test_server/test_attribute.rb
|
183
190
|
- lib/soaspec/version.rb
|
184
191
|
- soaspec.gemspec
|
185
192
|
- template/soap_template.xml
|