56 |
{ |
{ |
57 |
} |
} |
58 |
|
|
59 |
|
public void WriteMethodCall( string name ) |
60 |
|
{ |
61 |
|
WriteStartElement( "methodCall" ); |
62 |
|
WriteElementString( "methodName", name ); |
63 |
|
} |
64 |
|
|
65 |
|
public void WriteMethodCall( string name, object o ) |
66 |
|
{ |
67 |
|
WriteMethodCall( name ); |
68 |
|
WriteParams(); |
69 |
|
WriteParam( o ); |
70 |
|
} |
71 |
|
|
72 |
public void WriteMethodResponse() |
public void WriteMethodResponse() |
73 |
{ |
{ |
74 |
WriteStartElement( "methodResponse" ); |
WriteStartElement( "methodResponse" ); |
75 |
} |
} |
76 |
|
|
77 |
public void WriteMethodResponse( object o ) |
public void WriteMethodResponse( object o ) |
78 |
{ |
{ |
79 |
WriteMethodResponse(); |
WriteMethodResponse(); |
81 |
WriteParam( o ); |
WriteParam( o ); |
82 |
} |
} |
83 |
|
|
84 |
|
public void WriteMethodResponse( XmlRpcException e ) |
85 |
|
{ |
86 |
|
WriteMethodResponse(); |
87 |
|
WriteStartElement( "fault" ); |
88 |
|
XmlRpcStruct s = new XmlRpcStruct(); |
89 |
|
s.Add( "faultCode", e.FaultCode ); |
90 |
|
s.Add( "faultString", e.Message ); |
91 |
|
WriteValue( s ); |
92 |
|
WriteEndElement(); |
93 |
|
} |
94 |
|
|
95 |
|
public void WriteMethodResponse( Exception e ) |
96 |
|
{ |
97 |
|
XmlRpcException ex = new XmlRpcException( e ); |
98 |
|
WriteMethodResponse( ex ); |
99 |
|
} |
100 |
|
|
101 |
public void WriteParams() |
public void WriteParams() |
102 |
{ |
{ |
103 |
WriteStartElement( "params" ); |
WriteStartElement( "params" ); |
140 |
public void WriteDateTime( DateTime v ) |
public void WriteDateTime( DateTime v ) |
141 |
{ |
{ |
142 |
// ensure this is iso compliant |
// ensure this is iso compliant |
143 |
DateTime dt = (DateTime)v; |
Console.Out.WriteLine( "Writing DateTime: " + v ); |
144 |
|
|
145 |
// Why has MS got no clue about ISO 8601??? Horrid. All |
// Why has MS got no clue about ISO 8601??? Horrid. All |
146 |
// these newbies working on specs. this is as close as it |
// these newbies working on specs. this is as close as it |
147 |
// gets but not exactly since the 'T' can be left out |
// gets but not exactly since the 'T' can be left out |
148 |
WriteElementString( "dateTime.iso860", dt.ToString( "s" ) ); |
WriteElementString( "dateTime.iso8601", v.ToString( "s" ) ); |
149 |
} |
} |
150 |
|
|
151 |
public void WriteBase64( byte[] v ) |
public void WriteBase64( byte[] v ) |