soaspec 0.1.5 → 0.1.6
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 +5 -5
- data/.gitignore +15 -15
- data/.gitlab-ci.yml +48 -48
- data/.rspec +3 -3
- data/.rubocop.yml +2 -2
- data/CODE_OF_CONDUCT.md +74 -74
- data/ChangeLog +404 -400
- data/Gemfile +6 -6
- data/LICENSE.txt +21 -21
- data/README.md +113 -113
- data/Rakefile +24 -24
- data/Todo.md +6 -6
- data/exe/soaspec +109 -109
- data/exe/soaspec-virtual-server +156 -155
- data/exe/xml_to_yaml_file +60 -60
- data/lib/soaspec.rb +103 -103
- data/lib/soaspec/core_ext/hash.rb +83 -83
- data/lib/soaspec/exchange.rb +235 -235
- data/lib/soaspec/exchange_handlers/exchange_handler.rb +103 -103
- data/lib/soaspec/exchange_handlers/handler_accessors.rb +106 -106
- data/lib/soaspec/exchange_handlers/rest_accessors.rb +92 -92
- data/lib/soaspec/exchange_handlers/rest_handler.rb +314 -314
- data/lib/soaspec/exchange_handlers/rest_methods.rb +44 -44
- data/lib/soaspec/exchange_handlers/soap_handler.rb +236 -236
- data/lib/soaspec/exe_helpers.rb +60 -60
- data/lib/soaspec/generator/.rspec.erb +5 -5
- data/lib/soaspec/generator/.travis.yml.erb +5 -5
- data/lib/soaspec/generator/Gemfile.erb +8 -8
- data/lib/soaspec/generator/README.md.erb +29 -29
- data/lib/soaspec/generator/Rakefile.erb +19 -19
- data/lib/soaspec/generator/config/data/default.yml.erb +1 -1
- data/lib/soaspec/generator/lib/blz_service.rb.erb +26 -26
- data/lib/soaspec/generator/lib/dynamic_class_content.rb.erb +12 -12
- data/lib/soaspec/generator/lib/shared_example.rb.erb +8 -8
- data/lib/soaspec/generator/spec/dynamic_soap_spec.rb.erb +12 -12
- data/lib/soaspec/generator/spec/soap_spec.rb.erb +51 -51
- data/lib/soaspec/generator/spec/spec_helper.rb.erb +20 -20
- data/lib/soaspec/generator/template/soap_template.xml +6 -6
- data/lib/soaspec/interpreter.rb +40 -40
- data/lib/soaspec/matchers.rb +65 -65
- data/lib/soaspec/not_found_errors.rb +13 -13
- data/lib/soaspec/soaspec_shared_examples.rb +24 -24
- data/lib/soaspec/spec_logger.rb +27 -27
- data/lib/soaspec/test_server/bank.wsdl +90 -90
- data/lib/soaspec/test_server/get_bank.rb +160 -160
- data/lib/soaspec/test_server/id_manager.rb +31 -31
- data/lib/soaspec/test_server/invoices.rb +27 -27
- data/lib/soaspec/test_server/namespace.xml +14 -14
- data/lib/soaspec/test_server/note.xml +5 -5
- data/lib/soaspec/test_server/puppy_service.rb +20 -20
- data/lib/soaspec/test_server/test_attribute.rb +13 -13
- data/lib/soaspec/test_server/test_namespace.rb +12 -12
- data/lib/soaspec/version.rb +2 -2
- data/lib/soaspec/wsdl_generator.rb +144 -144
- data/soaspec.gemspec +46 -47
- data/test.wsdl +116 -116
- data/test.xml +10 -10
- data/test_wsdl.rb +43 -43
- metadata +6 -6
| @@ -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,32 +1,32 @@ | |
| 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
         | 
| 5 | 
            -
                class IdManager
         | 
| 6 | 
            -
                  @developed = false
         | 
| 7 | 
            -
                  class << self
         | 
| 8 | 
            -
             | 
| 9 | 
            -
                    attr_accessor :developed
         | 
| 10 | 
            -
             | 
| 11 | 
            -
                    # @return  Result depending on num, id and whether '@developed' is set
         | 
| 12 | 
            -
                    def result_for(num, id)
         | 
| 13 | 
            -
                      result = undeveloped_id(num, id) unless @developed
         | 
| 14 | 
            -
                      result || 'true'
         | 
| 15 | 
            -
                    end
         | 
| 16 | 
            -
             | 
| 17 | 
            -
                    # @return [String] true of false depending on num and id
         | 
| 18 | 
            -
                    def undeveloped_id(num, id)
         | 
| 19 | 
            -
                      case num
         | 
| 20 | 
            -
                      when '1', '4', '10' then 'false' if id == '40'
         | 
| 21 | 
            -
                      when '3', '11', '9' then 'false' if id == '74'
         | 
| 22 | 
            -
                      when '8', '6', '8' then 'false' if id == '80'
         | 
| 23 | 
            -
                      when '7', '5', '12' then 'false' if id == '64'
         | 
| 24 | 
            -
                      else
         | 
| 25 | 
            -
                        'true'
         | 
| 26 | 
            -
                      end
         | 
| 27 | 
            -
                    end
         | 
| 28 | 
            -
             | 
| 29 | 
            -
                  end
         | 
| 30 | 
            -
                end
         | 
| 31 | 
            -
              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
         | 
| 5 | 
            +
                class IdManager
         | 
| 6 | 
            +
                  @developed = false
         | 
| 7 | 
            +
                  class << self
         | 
| 8 | 
            +
             | 
| 9 | 
            +
                    attr_accessor :developed
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                    # @return  Result depending on num, id and whether '@developed' is set
         | 
| 12 | 
            +
                    def result_for(num, id)
         | 
| 13 | 
            +
                      result = undeveloped_id(num, id) unless @developed
         | 
| 14 | 
            +
                      result || 'true'
         | 
| 15 | 
            +
                    end
         | 
| 16 | 
            +
             | 
| 17 | 
            +
                    # @return [String] true of false depending on num and id
         | 
| 18 | 
            +
                    def undeveloped_id(num, id)
         | 
| 19 | 
            +
                      case num
         | 
| 20 | 
            +
                      when '1', '4', '10' then 'false' if id == '40'
         | 
| 21 | 
            +
                      when '3', '11', '9' then 'false' if id == '74'
         | 
| 22 | 
            +
                      when '8', '6', '8' then 'false' if id == '80'
         | 
| 23 | 
            +
                      when '7', '5', '12' then 'false' if id == '64'
         | 
| 24 | 
            +
                      else
         | 
| 25 | 
            +
                        'true'
         | 
| 26 | 
            +
                      end
         | 
| 27 | 
            +
                    end
         | 
| 28 | 
            +
             | 
| 29 | 
            +
                  end
         | 
| 30 | 
            +
                end
         | 
| 31 | 
            +
              end
         | 
| 32 32 | 
             
            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>
         |