1 |
|
namespace DGEE.Admin |
2 |
|
{ |
3 |
|
using System; |
4 |
|
using Goldwater; |
5 |
|
using System.Web.Services; |
6 |
|
using DotGNU.XmlRpc; |
7 |
|
|
8 |
|
|
9 |
|
[WebService(Description="DGEE Administration User Handlers", Namespace="http://nfluid.com")] |
10 |
|
public class UserAdmin |
11 |
|
{ |
12 |
|
[WebMethod("GetUser", Description="Locates and returns info about the supplied user. Users are of the form user@address")] |
13 |
|
public static String GetUser( String who ) |
14 |
|
{ |
15 |
|
String res; |
16 |
|
|
17 |
|
try { |
18 |
|
String lmsg; |
19 |
|
|
20 |
|
//GWLog log = new GWLog(); |
21 |
|
//lmsg = "Getting info for user'"+who+"'"; |
22 |
|
//log.Write( GWLogLevel.LOG_DEBUG, lmsg ); |
23 |
|
|
24 |
|
GWMsgChain msg = new GWMsgChain(); |
25 |
|
|
26 |
|
msg.Add( (uint)DGF.USERNAME, who ); |
27 |
|
|
28 |
|
using ( GWMessage request = new GWMessage() ) { |
29 |
|
|
30 |
|
msg = request.SendTo( "/DGEE/ADM/GetUser", msg ); |
31 |
|
|
32 |
|
String user = msg.Get( (uint)DGF.USERNAME ); |
33 |
|
String real = msg.Get( (uint)DGF.REALNAME ); |
34 |
|
String email = msg.Get( (uint)DGF.EMAIL_ADDR ); |
35 |
|
String web = msg.Get( (uint)DGF.WEB_ADDR ); |
36 |
|
|
37 |
|
res = "User: "+user+" Real: "+real+" Email: "+email+" Web: "+web; |
38 |
|
} |
39 |
|
} |
40 |
|
catch( Exception xept ) |
41 |
|
{ |
42 |
|
if( xept is Goldwater.GWException ) { |
43 |
|
Console.WriteLine( "Oh dear. Something seems to have gone wrong, probably {0}", xept.Message ); |
44 |
|
} else { |
45 |
|
Console.WriteLine( "Some other exception" ); |
46 |
|
} |
47 |
|
} |
48 |
|
return res; |
49 |
|
} |
50 |
|
} |
51 |
|
} // GoldTest |