diff options
Diffstat (limited to 'actionwebservice/lib/action_web_service/client')
-rw-r--r-- | actionwebservice/lib/action_web_service/client/soap_client.rb | 16 | ||||
-rw-r--r-- | actionwebservice/lib/action_web_service/client/xmlrpc_client.rb | 4 |
2 files changed, 11 insertions, 9 deletions
diff --git a/actionwebservice/lib/action_web_service/client/soap_client.rb b/actionwebservice/lib/action_web_service/client/soap_client.rb index b93f6475d9..d3975d89a2 100644 --- a/actionwebservice/lib/action_web_service/client/soap_client.rb +++ b/actionwebservice/lib/action_web_service/client/soap_client.rb @@ -24,14 +24,16 @@ module ActionWebService # :nodoc: # will be sent with HTTP POST. # # Valid options: - # [<tt>:service_name</tt>] If the remote server has used a custom +wsdl_service_name+ - # option, you must specify it here + # [<tt>:type_namespace</tt>] If the remote server has used a custom namespace to + # declare its custom types, you can specify it here + # [<tt>:method_namespace</tt>] If the remote server has used a custom namespace to + # declare its methods, you can specify it here def initialize(api, endpoint_uri, options={}) super(api, endpoint_uri) - @service_name = options[:service_name] - @namespace = @service_name ? '' : "urn:#{@service_name}" - @marshaler = WS::Marshaling::SoapMarshaler.new - @encoder = WS::Encoding::SoapRpcEncoding.new + @type_namespace = options[:type_namespace] || 'urn:ActionWebService' + @method_namespace = options[:method_namespace] || 'urn:ActionWebService' + @marshaler = WS::Marshaling::SoapMarshaler.new @type_namespace + @encoder = WS::Encoding::SoapRpcEncoding.new @method_namespace @soap_action_base = options[:soap_action_base] @soap_action_base ||= URI.parse(endpoint_uri).path @driver = create_soap_rpc_driver(api, endpoint_uri) @@ -53,7 +55,7 @@ module ActionWebService # :nodoc: driver.mapping_registry = @marshaler.registry api.api_methods.each do |name, info| public_name = api.public_api_method_name(name) - qname = XSD::QName.new(@namespace, public_name) + qname = XSD::QName.new(@method_namespace, public_name) action = soap_action(public_name) expects = info[:expects] returns = info[:returns] diff --git a/actionwebservice/lib/action_web_service/client/xmlrpc_client.rb b/actionwebservice/lib/action_web_service/client/xmlrpc_client.rb index dc7ad1517f..27fe537404 100644 --- a/actionwebservice/lib/action_web_service/client/xmlrpc_client.rb +++ b/actionwebservice/lib/action_web_service/client/xmlrpc_client.rb @@ -56,7 +56,7 @@ module ActionWebService # :nodoc: i = 0 expects.each do |spec| type_binding = @marshaler.register_type(spec) - info = WS::ParamInfo.create(spec, i, type_binding) + info = WS::ParamInfo.create(spec, type_binding, i) params[i] = @marshaler.marshal(WS::Param.new(params[i], info)) i += 1 end @@ -68,7 +68,7 @@ module ActionWebService # :nodoc: info = @api.api_methods[method_name.to_sym] return true unless returns = info[:returns] type_binding = @marshaler.register_type(returns[0]) - info = WS::ParamInfo.create(returns[0], 0, type_binding) + info = WS::ParamInfo.create(returns[0], type_binding, 0) info.name = 'return' @marshaler.transform_inbound(WS::Param.new(return_value, info)) end |