]> err.no Git - sope/blob - sope-appserver/NGXmlRpc/XmlRpcMethodCall+WO.m
moved NGXmlRpc out of NGObjWeb to an own project
[sope] / sope-appserver / NGXmlRpc / XmlRpcMethodCall+WO.m
1 /*
2   Copyright (C) 2000-2003 SKYRIX Software AG
3
4   This file is part of OGo
5
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
9   later version.
10
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.
15
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
19   02111-1307, USA.
20 */
21 // $Id$
22
23 #include <XmlRpc/XmlRpcMethodCall.h>
24 #include <NGObjWeb/WORequest.h>
25 #include "common.h"
26
27 @implementation XmlRpcMethodCall(WO)
28
29 // TODO: not required anymore by NGXmlRpcClient, can be removed ?
30
31 - (id)initWithRequest:(WORequest *)_request {
32   /* do not use -initWithXmlRpcString here !!! */
33   return [self initWithXmlRpcData:[_request content]];
34 }
35
36 - (WORequest *)generateRequestWithUri:(NSString *)_uri {
37   WORequest *request;
38   
39   request = [[WORequest alloc] initWithMethod:@"POST"
40                                uri:_uri
41                                httpVersion:@"HTTP/1.0"
42                                headers:nil
43                                content:nil
44                                userInfo:nil];
45
46   [request setHeader:@"text/xml" forKey:@"content-type"];
47   [request setContentEncoding:NSUTF8StringEncoding];
48   
49   [request appendContentString:[self xmlRpcString]];
50   
51   return [request autorelease];
52 }
53
54 @end /* XmlRpcMethodCall(WO) */