lib/soaspec/exchange_handlers/soap_handler.rb in soaspec-0.1.9 vs lib/soaspec/exchange_handlers/soap_handler.rb in soaspec-0.1.10

- old
+ new

@@ -97,19 +97,18 @@ # Used in together with Exchange request that passes such override parameters # @param [Hash] request_parameters Parameters used to overwrite defaults in request def make_request(request_parameters) test_values = request_body_params request_parameters + # Call the SOAP operation with the request XML provided begin if @request_option == :template - request_body = File.read(File.join(Soaspec.template_folder, template_name)) - render_body = ERB.new(request_body).result(binding) - client.call(operation, xml: render_body) # Call the SOAP operation with the request XML provided + client.call(operation, xml: Soaspec::TemplateReader.new.render_body(template_name, binding)) elsif @request_option == :hash client.call(operation, message: @default_hash.merge(test_values), attributes: request_root_attributes) end - rescue Savon::HTTPError => e - e + rescue Savon::HTTPError => soap_error + soap_error end end # @param [Hash] format Format of expected result # @return [Object] Generic body to be displayed in error messages \ No newline at end of file