Permalink
Browse files

Add API::Base.soap_client and API::Base.xmlrpc_client helper methods …

…to construct

an internal client.

Example:

{{{
$ ./script/console
>> c = MyApi.soap_client 'http://app.com/ws/api'
>> c.method arg1, arg2
}}}


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1994 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent c005ed1 commit eaadd18f3f2c8e59a79f451e706aa15447c10018 @leonbreedt leonbreedt committed Aug 12, 2005
@@ -1,5 +1,7 @@
*SVN*
+* Added ActionWebService::API::Base.soap_client and ActionWebService::API::Base.xmlrpc_client helper methods to create the internal clients for an API, useful for testing from ./script/console
+
* ActionWebService now always returns UTF-8 responses.
*0.8.1* (11 July, 2005)
@@ -1,7 +1,16 @@
require 'action_web_service/protocol/soap_protocol/marshaler'
require 'soap/streamHandler'
+require 'action_web_service/client/soap_client'
module ActionWebService # :nodoc:
+ module API # :nodoc:
+ class Base # :nodoc:
+ def self.soap_client(endpoint_uri, options={})
+ ActionWebService::Client::Soap.new self, endpoint_uri, options
+ end
+ end
+ end
+
module Protocol # :nodoc:
module Soap # :nodoc:
def self.included(base)
@@ -1,4 +1,5 @@
require 'xmlrpc/marshal'
+require 'action_web_service/client/xmlrpc_client'
module XMLRPC # :nodoc:
class FaultException # :nodoc:
@@ -7,6 +8,14 @@ class FaultException # :nodoc:
end
module ActionWebService # :nodoc:
+ module API # :nodoc:
+ class Base # :nodoc:
+ def self.xmlrpc_client(endpoint_uri, options={})
+ ActionWebService::Client::XmlRpc.new self, endpoint_uri, options
+ end
+ end
+ end
+
module Protocol # :nodoc:
module XmlRpc # :nodoc:
def self.included(base)

0 comments on commit eaadd18

Please sign in to comment.