2 Copyright (C) 2000-2005 SKYRIX Software AG
4 This file is part of SOPE.
6 SOPE 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 SOPE 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 SOPE; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #ifndef __NGXmlRpcClient_H__
23 #define __NGXmlRpcClient_H__
25 #import <Foundation/NSObject.h>
30 This class is a raw XML-RPC client based on WOHTTPConnection. To see how
31 it works, take a look at the xmlrpc_call.m tool included in SOPE 4.5.
33 XML-RPC over Unix domain sockets. NGXmlRpcClient (will) support XML-RPC over
34 a Unix domain socket, as used in the ximian_xmlrpclib.py. The transport
35 protocol used is "$body$\r\n\r\n".
38 NGXmlRpcClient *server;
41 [[NGXmlRpcClient alloc] initWithURL:@"http://betty.userland.com/RPC2"];
43 NSLog(@"result: %@", [server call:@"state.getByNumber", @"42", nil]);
46 @class NSArray, NSString, NSURL, NSDictionary;
47 @class WOHTTPConnection;
49 @interface NGXmlRpcClient : NSObject
51 /* performing HTTP requests */
52 WOHTTPConnection *httpConnection;
56 NSDictionary *additionalHeaders;
58 /* performing RAW requests */
61 /* some transactional state is required for digest authentication */
64 // TODO: add timeout parameters
67 - (id)initWithURL:(id)_url;
68 - (id)initWithURL:(id)_url login:(NSString *)_login password:(NSString *)_pwd;
70 - (id)initWithRawAddress:(id)_address;
74 - (void)setUserName:(NSString *)_userName;
75 - (NSString *)userName;
78 - (void)setPassword:(NSString *)_password;
79 - (NSString *)password;
81 - (void)setUri:(NSString *)_uri;
84 - (void)setAdditionalHeaders:(NSDictionary *)_headers;
85 - (NSDictionary *)additionalHeaders;
87 /* invoking methods */
89 - (id)invoke:(NSString *)_methodName params:(id)first,...;
91 - (id)invokeMethodNamed:(NSString *)_methodName;
92 - (id)invokeMethodNamed:(NSString *)_methodName withParameter:(id)_param;
93 - (id)invokeMethodNamed:(NSString *)_methodName parameters:(NSArray *)_params;
96 terminate parameter list with nil, eg:
98 [rpc call:@"state.getByNumber", @"42", nil];
100 - (id)call:(NSString *)_methodName,...;
104 #endif /* __NGXmlRpcClient_H__ */