aboutsummaryrefslogtreecommitdiffstats
path: root/actionwebservice
diff options
context:
space:
mode:
authorLeon Breedt <bitserf@gmail.com>2005-08-12 16:38:42 +0000
committerLeon Breedt <bitserf@gmail.com>2005-08-12 16:38:42 +0000
commiteaadd18f3f2c8e59a79f451e706aa15447c10018 (patch)
treea529087aef158e38c1d9ea394d74ce7dfd4a9a95 /actionwebservice
parentc005ed17a399a0a37c40c5146c4876abcd51b249 (diff)
downloadrails-eaadd18f3f2c8e59a79f451e706aa15447c10018.tar.gz
rails-eaadd18f3f2c8e59a79f451e706aa15447c10018.tar.bz2
rails-eaadd18f3f2c8e59a79f451e706aa15447c10018.zip
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
Diffstat (limited to 'actionwebservice')
-rw-r--r--actionwebservice/CHANGELOG2
-rw-r--r--actionwebservice/lib/action_web_service/protocol/soap_protocol.rb9
-rw-r--r--actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb9
3 files changed, 20 insertions, 0 deletions
diff --git a/actionwebservice/CHANGELOG b/actionwebservice/CHANGELOG
index 8b2d63e804..e21a9e73ba 100644
--- a/actionwebservice/CHANGELOG
+++ b/actionwebservice/CHANGELOG
@@ -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)
diff --git a/actionwebservice/lib/action_web_service/protocol/soap_protocol.rb b/actionwebservice/lib/action_web_service/protocol/soap_protocol.rb
index b28d57d00e..1bce496a7b 100644
--- a/actionwebservice/lib/action_web_service/protocol/soap_protocol.rb
+++ b/actionwebservice/lib/action_web_service/protocol/soap_protocol.rb
@@ -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)
diff --git a/actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb b/actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb
index 2ee5af7c3f..53b67ced4c 100644
--- a/actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb
+++ b/actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb
@@ -1,4 +1,5 @@
require 'xmlrpc/marshal'
+require 'action_web_service/client/xmlrpc_client'
module XMLRPC # :nodoc:
class FaultException # :nodoc:
@@ -7,6 +8,14 @@ module XMLRPC # :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)