Permalink
Browse files

Namespace modification support (Fixes #13); 0.3.3 tick

  • Loading branch information...
1 parent bc93775 commit 9f0072930e2a4715b0535b43c3b1ce81e53d0a6e @inossidabile inossidabile committed Mar 17, 2012
Showing with 27 additions and 7 deletions.
  1. +5 −0 CHANGELOG.md
  2. +5 −0 README.md
  3. +8 −0 lib/wash_out.rb
  4. +7 −5 lib/wash_out/dispatcher.rb
  5. +1 −1 lib/wash_out/engine.rb
  6. +1 −1 lib/wash_out/version.rb
View
@@ -1,5 +1,10 @@
# Changelog
+## 0.3.3
+
+* Tiny fixes in wash_out behavior with inline arrays (#11, #12)
+* Ability to change namespace
+
## 0.3.2
* WashOut doesn't check existance of parameters anymore you should do it yourself from now
View
@@ -122,6 +122,11 @@ result.to_hash # => {:value=>"123abc"}
Take a look at [WashOut sample application](https://github.com/roundlake/wash_out-sample).
+Namespace
+---------
+
+Use `config.action_view.washout_namespace = 'urn:test'` inside your environment configuration to modify default `urn:WashOut` namespace.
+
License
-------
View
@@ -15,6 +15,14 @@ def wash_out(controller_name, options={})
end
Mime::Type.register "application/soap+xml", :soap
+
ActionController::Renderers.add :soap do |what, options|
_render_soap(what, options)
+end
+
+module ActionView
+ class Base
+ cattr_accessor :washout_namespace
+ @@washout_namespace = false
+ end
end
View
@@ -5,13 +5,15 @@ module WashOut
# as a SOAP endpoint. It includes actions for generating WSDL and handling
# SOAP requests.
module Dispatcher
- # Default Type namespace
- NAMESPACE = 'urn:WashOut'
-
# A SOAPError exception can be raised to return a correct SOAP error
# response.
class SOAPError < Exception; end
+ def namespace
+ namespace = ActionView::Base.washout_namespace if defined?(ActionView::Base)
+ namespace ||= 'urn:WashOut'
+ end
+
# This filter parses the SOAP request and puts it into +params+ array.
def _parse_soap_parameters
soap_action = request.env['wash_out.soap_action']
@@ -62,15 +64,15 @@ def _parse_soap_parameters
# This action generates the WSDL for defined SOAP methods.
def _generate_wsdl
@map = self.class.soap_actions
- @namespace = NAMESPACE
+ @namespace = namespace
@name = controller_path.gsub('/', '_')
render :template => 'wash_with_soap/wsdl'
end
# Render a SOAP response.
def _render_soap(result, options)
- @namespace = NAMESPACE
+ @namespace = namespace
@operation = soap_action = request.env['wash_out.soap_action']
action_spec = self.class.soap_actions[soap_action][:out].clone
View
@@ -1,4 +1,4 @@
module WashOut
class Engine < ::Rails::Engine
end
-end
+end
View
@@ -1,3 +1,3 @@
module WashOut
- VERSION = "0.3.2"
+ VERSION = "0.3.3"
end

0 comments on commit 9f00729

Please sign in to comment.