/[dgee]/dgee/cslib/DotGNU/DGEE/Protocols/XmlRpc/XmlRpcReplyHandler.cs
ViewVC logotype

Diff of /dgee/cslib/DotGNU/DGEE/Protocols/XmlRpc/XmlRpcReplyHandler.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.2.4.2.5 by npg, Wed Jul 23 11:25:59 2003 UTC revision 1.1.2.4.2.6 by npg, Thu Jul 24 16:33:43 2003 UTC
# Line 23  Line 23 
23   * Authors:   * Authors:
24   *   Nicolai P Guba   *   Nicolai P Guba
25   */   */
26    using System.IO;
27  using DotGNU.XmlRpc;  using DotGNU.XmlRpc;
28  using DotGNU.DGEE;  using DotGNU.DGEE;
29    
# Line 32  namespace DotGNU.DGEE.Protocols.XmlRpc Line 33  namespace DotGNU.DGEE.Protocols.XmlRpc
33    {    {
34      public String GetReply( String assemblyName, String className, String methodName )      public String GetReply( String assemblyName, String className, String methodName )
35      {      {
36        XmlRpcWriter writer = new XmlRpcWriter();              StringWriter sw     = new StringWriter();
37        XmlRpcStruct h = new XmlRpcStruct();        XmlRpcWriter writer = new XmlRpcWriter( sw );      
38          XmlRpcStruct h      = new XmlRpcStruct();
39    
40        int i = 1;        int i = 1;
41        double d = 2.99;        double d = 2.99;
42        bool b = false;        bool b = false;
43        byte[] bytes = {0x00, 0x12, 0x34, 0x56, 0xAA, 0x55, 0xFF};        byte[] bytes = {0x00, 0x12, 0x34, 0x56, 0xAA, 0x55, 0xFF};
44    
45        h["one"] = i;        h["one"]   = i;
46        h["two"] = d;        h["two"]   = d;
47        h["three"] = b;        h["three"] = b;
48    
49        XmlRpcStruct h0 = new XmlRpcStruct();        XmlRpcStruct h0 = new XmlRpcStruct();
# Line 59  namespace DotGNU.DGEE.Protocols.XmlRpc Line 61  namespace DotGNU.DGEE.Protocols.XmlRpc
61        a.Add( bytes );        a.Add( bytes );
62        h["An array"] = a;        h["An array"] = a;
63    
64        string reply = writer.Parse( h );        // use the XmlRpcWriter just like you would XmlTextWriter.  In
65          // fact it inherits XmlTextWriter but detection of invalid
66          // states is not implemented yet.  That'll come soon
67          //writer.WriteStartDocument();
68          writer.WriteMethodResponse( h );
69          //writer.WriteEndDocument();
70    
71          string reply = sw.ToString();
72          
73          // feed it into the reader to detect anomalies
74          XmlRpcReader reader = new XmlRpcReader( reply );
75    
76          Console.Out.WriteLine( "XmlRpcReader\n{0}", reader );
77        return reply;        return reply;
78      }      }
79    }    }

Legend:
Removed from v.1.1.2.4.2.5  
changed lines
  Added in v.1.1.2.4.2.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26