2 Copyright (C) 2000-2004 SKYRIX Software AG
4 This file is part of OpenGroupware.org.
6 OGo is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 #ifndef __NGXmlRpcClient_H__
24 #define __NGXmlRpcClient_H__
26 #import <Foundation/NSObject.h>
31 This class is a raw XML-RPC client based on WOHTTPConnection. To see how
32 it works, take a look at the xmlrpc_call.m tool included in SOPE 4.3.
34 XML-RPC over Unix domain sockets. NGXmlRpcClient (will) support XML-RPC over
35 a Unix domain socket, as used in the ximian_xmlrpclib.py. The transport
36 protocol used is "$body$\r\n\r\n".
39 NGXmlRpcClient *server;
42 [[NGXmlRpcClient alloc] initWithURL:@"http://betty.userland.com/RPC2"];
44 NSLog(@"result: %@", [server call:@"state.getByNumber", @"42", nil]);
47 @class NSArray, NSString, NSURL, NSDictionary;
48 @class WOHTTPConnection;
50 @interface NGXmlRpcClient : NSObject
52 /* performing HTTP requests */
53 WOHTTPConnection *httpConnection;
57 NSDictionary *additionalHeaders;
59 /* performing RAW requests */
62 /* some transactional state is required for digest authentication */
65 // TODO: add timeout parameters
68 - (id)initWithURL:(id)_url;
69 - (id)initWithURL:(id)_url login:(NSString *)_login password:(NSString *)_pwd;
71 - (id)initWithRawAddress:(id)_address;
75 - (void)setUserName:(NSString *)_userName;
76 - (NSString *)userName;
79 - (void)setPassword:(NSString *)_password;
80 - (NSString *)password;
82 - (void)setUri:(NSString *)_uri;
85 - (void)setAdditionalHeaders:(NSDictionary *)_headers;
86 - (NSDictionary *)additionalHeaders;
88 /* invoking methods */
90 - (id)invoke:(NSString *)_methodName params:(id)first,...;
92 - (id)invokeMethodNamed:(NSString *)_methodName;
93 - (id)invokeMethodNamed:(NSString *)_methodName withParameter:(id)_param;
94 - (id)invokeMethodNamed:(NSString *)_methodName parameters:(NSArray *)_params;
97 terminate parameter list with nil, eg:
99 [rpc call:@"state.getByNumber", @"42", nil];
101 - (id)call:(NSString *)_methodName,...;
105 #endif /* __NGXmlRpcClient_H__ */