diff options
author | Leon Breedt <bitserf@gmail.com> | 2005-06-25 06:27:39 +0000 |
---|---|---|
committer | Leon Breedt <bitserf@gmail.com> | 2005-06-25 06:27:39 +0000 |
commit | ebb6fb09280f828258432223fd543de9dfda6370 (patch) | |
tree | 27a5aba70164b1a9d0264d8c04b4df14f49317e5 /actionwebservice/lib/action_web_service/protocol/soap_protocol.rb | |
parent | af33a6a6b193f4470d2c072d6fa197b72c74001b (diff) | |
download | rails-ebb6fb09280f828258432223fd543de9dfda6370.tar.gz rails-ebb6fb09280f828258432223fd543de9dfda6370.tar.bz2 rails-ebb6fb09280f828258432223fd543de9dfda6370.zip |
fix WSDL generation, change the way protocols are instantiated, and add
the ability to override the namespace used in WSDL instead of always forcing
'urn:ActionWebService'
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1501 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionwebservice/lib/action_web_service/protocol/soap_protocol.rb')
-rw-r--r-- | actionwebservice/lib/action_web_service/protocol/soap_protocol.rb | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/actionwebservice/lib/action_web_service/protocol/soap_protocol.rb b/actionwebservice/lib/action_web_service/protocol/soap_protocol.rb index 3e5bad0086..e6bb5488ab 100644 --- a/actionwebservice/lib/action_web_service/protocol/soap_protocol.rb +++ b/actionwebservice/lib/action_web_service/protocol/soap_protocol.rb @@ -7,13 +7,21 @@ module ActionWebService # :nodoc: def self.included(base) base.register_protocol(SoapProtocol) base.class_inheritable_option(:wsdl_service_name) + base.class_inheritable_option(:wsdl_namespace) end class SoapProtocol < AbstractProtocol # :nodoc: DefaultEncoding = 'utf-8' - def marshaler - @marshaler ||= SoapMarshaler.new + attr :marshaler + + def initialize(namespace=nil) + namespace ||= 'urn:ActionWebService' + @marshaler = SoapMarshaler.new namespace + end + + def self.create(controller) + SoapProtocol.new(controller.wsdl_namespace) end def decode_action_pack_request(action_pack_request) @@ -47,7 +55,7 @@ module ActionWebService # :nodoc: def encode_request(method_name, params, param_types) param_types.each{ |type| marshaler.register_type(type) } if param_types - qname = XSD::QName.new(marshaler.type_namespace, method_name) + qname = XSD::QName.new(marshaler.namespace, method_name) param_def = [] if param_types params = param_types.zip(params).map do |type, param| @@ -79,7 +87,7 @@ module ActionWebService # :nodoc: return_binding = marshaler.register_type(return_type) marshaler.annotate_arrays(return_binding, return_value) end - qname = XSD::QName.new(marshaler.type_namespace, method_name) + qname = XSD::QName.new(marshaler.namespace, method_name) if return_value.nil? response = SOAP::RPC::SOAPMethodResponse.new(qname, nil) else |