diff options
author | Leon Breedt <bitserf@gmail.com> | 2005-08-12 16:38:42 +0000 |
---|---|---|
committer | Leon Breedt <bitserf@gmail.com> | 2005-08-12 16:38:42 +0000 |
commit | eaadd18f3f2c8e59a79f451e706aa15447c10018 (patch) | |
tree | a529087aef158e38c1d9ea394d74ce7dfd4a9a95 /actionwebservice/lib | |
parent | c005ed17a399a0a37c40c5146c4876abcd51b249 (diff) | |
download | rails-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/lib')
-rw-r--r-- | actionwebservice/lib/action_web_service/protocol/soap_protocol.rb | 9 | ||||
-rw-r--r-- | actionwebservice/lib/action_web_service/protocol/xmlrpc_protocol.rb | 9 |
2 files changed, 18 insertions, 0 deletions
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) |