From ebb6fb09280f828258432223fd543de9dfda6370 Mon Sep 17 00:00:00 2001 From: Leon Breedt Date: Sat, 25 Jun 2005 06:27:39 +0000 Subject: 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 --- .../lib/action_web_service/client/soap_client.rb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'actionwebservice/lib/action_web_service/client/soap_client.rb') diff --git a/actionwebservice/lib/action_web_service/client/soap_client.rb b/actionwebservice/lib/action_web_service/client/soap_client.rb index 79edac0b71..f5ebe1629c 100644 --- a/actionwebservice/lib/action_web_service/client/soap_client.rb +++ b/actionwebservice/lib/action_web_service/client/soap_client.rb @@ -24,10 +24,10 @@ module ActionWebService # :nodoc: # will be sent with HTTP POST. # # Valid options: - # [:type_namespace] If the remote server has used a custom namespace to - # declare its custom types, you can specify it here - # [:method_namespace] If the remote server has used a custom namespace to - # declare its methods, you can specify it here + # [:namespace] If the remote server has used a custom namespace to + # declare its custom types, you can specify it here. This would + # be the namespace declared with a [WebService(Namespace = "http://namespace")] attribute + # in .NET, for example. # [:driver_options] If you want to supply any custom SOAP RPC driver # options, you can provide them as a Hash here # @@ -43,10 +43,9 @@ module ActionWebService # :nodoc: # client = ActionWebService::Client::Soap.new(api, 'https://some/service', :driver_options => opts) def initialize(api, endpoint_uri, options={}) super(api, endpoint_uri) - @type_namespace = options[:type_namespace] || 'urn:ActionWebService' - @method_namespace = options[:method_namespace] || 'urn:ActionWebService' + @namespace = options[:namespace] || 'urn:ActionWebService' @driver_options = options[:driver_options] || {} - @protocol = ActionWebService::Protocol::Soap::SoapProtocol.new + @protocol = ActionWebService::Protocol::Soap::SoapProtocol.new @namespace @soap_action_base = options[:soap_action_base] @soap_action_base ||= URI.parse(endpoint_uri).path @driver = create_soap_rpc_driver(api, endpoint_uri) @@ -73,7 +72,7 @@ module ActionWebService # :nodoc: driver = SoapDriver.new(endpoint_uri, nil) driver.mapping_registry = @protocol.marshaler.registry api.api_methods.each do |name, method| - qname = XSD::QName.new(@method_namespace, method.public_name) + qname = XSD::QName.new(@namespace, method.public_name) action = soap_action(method.public_name) expects = method.expects returns = method.returns -- cgit v1.2.3