1 |
/* |
/* |
2 |
* DotGNU XmlRpc implementation |
* DotGNU XmlRpc implementation |
3 |
* |
* |
4 |
* Copyright (C) 2002 netFluid Technology Ltd |
* Copyright (C) 2003 Free Software Foundation, Inc. |
5 |
* |
* |
6 |
* This program is free software; you can redistribute it and/or modify |
* This program is free software; you can redistribute it and/or modify |
7 |
* it under the terms of the GNU General Public License as published by |
* it under the terms of the GNU General Public License as published by |
21 |
* |
* |
22 |
* -------------------------------------------------------------------------- |
* -------------------------------------------------------------------------- |
23 |
*/ |
*/ |
24 |
|
//using System.Reflection; |
25 |
|
using System.Collections; |
26 |
|
using System.Globalization; |
27 |
|
using System.IO; |
28 |
|
using System.Xml; |
29 |
|
|
30 |
namespace DotGNU.XmlRpc |
namespace DotGNU.XmlRpc |
31 |
{ |
{ |
32 |
using System.Reflection; |
public class XmlRpcMethod : XmlRpcObject |
|
using System.Collections; |
|
|
|
|
|
public class XmlRpcMethod |
|
33 |
{ |
{ |
34 |
protected String name; // Name of method being called |
private string assembly; |
|
protected IList parameters = new ArrayList(); // List of parameters being passed |
|
35 |
|
|
36 |
public XmlRpcMethod() |
public XmlRpcMethod() |
37 |
{ |
{ |
38 |
} |
} |
39 |
|
|
40 |
public XmlRpcMethod( String methodName ) |
public XmlRpcMethod( string name ) |
41 |
{ |
{ |
42 |
name = methodName; |
methodName = name; |
43 |
} |
} |
44 |
|
|
45 |
public String Name |
public string Name |
46 |
{ |
{ |
47 |
get { |
get { |
48 |
return this.name; |
return this.methodName; |
|
} |
|
|
set { |
|
|
this.name = value; |
|
49 |
} |
} |
50 |
} |
} |
51 |
|
|
52 |
public IList Parameters |
public String Assembly |
53 |
{ |
{ |
54 |
get { |
get { |
55 |
return this.parameters; |
return assembly; |
56 |
|
} |
57 |
|
set { |
58 |
|
assembly = value; |
59 |
} |
} |
60 |
} |
} |
61 |
|
|
62 |
|
public XmlRpcResponse Invoke() |
63 |
|
{ |
64 |
|
// Ensure that we support method aliasing. Ie the method name |
65 |
|
// comes from goldwater and not the xmlrpc request (support for |
66 |
|
// method aliasing) |
67 |
|
|
68 |
|
// for now we just return that simple integer |
69 |
|
XmlRpcResponse response = new XmlRpcResponse(); |
70 |
|
int i = 1234567890; |
71 |
|
response.Add( i ); |
72 |
|
return response; |
73 |
|
} |
74 |
|
|
75 |
public override string ToString() |
public override string ToString() |
76 |
{ |
{ |
77 |
string s = String.Format( "XmlRpcMethod: name='{0}', parameters='{1}'", name, parameters.Count ); |
string s = String.Format( "XmlRpcMethod: name='{0}' parameter count='{1}'\n", methodName, this.Count ); |
78 |
|
foreach( object obj in this ) { |
79 |
|
s+= String.Format( "Type: {0}, Value: {1}\n", obj.GetType(), obj ); |
80 |
|
} |
81 |
return s; |
return s; |
82 |
} |
} |
83 |
} |
} |