你好,我是新来的,最近在做一个delphi调用c#写的webservice的程序c#进行soap编码以后传给我,我怎么进行解码呀?有谁做过类似的东东给点提示吧,我是刚接触这些东西的。

解决方案 »

  1.   

    先参考一下这个帖子
    http://topic.csdn.net/u/20070128/21/b1a889cc-ff7e-4c8a-a339-6b67fc475a61.html
      

  2.   

    ������˼,����������ŽӴ���Щ������,�������Ǹ�����.
    ���� c# �еĴ���:
    ���룺
    DataSet ds;
            ds = DbTools.GetDS("select * from D_Users", "D_Users");
            MemoryStream s = new MemoryStream();
            //BinaryFormatter bf = new BinaryFormatter();
            SoapFormatter sf = new SoapFormatter();
            sf.Serialize(s, ds);
            //bf.Serialize(s, ds);
            byte[] e = s.ToArray();
            return e;
            s.Close();
            s.Dispose(); 
    ���룺
            localhost.returnbyte returnbyte = new localhost.returnbyte();
            byte[] resultbyte = returnbyte.SurrogateRead();
            MemoryStream br = new MemoryStream(resultbyte);
           // BinaryFormatter bf = new BinaryFormatter();
            SoapFormatter sf = new SoapFormatter();
            object obj = sf.Deserialize(br); 
            DataSet ds = new DataSet();
            ds = (DataSet)obj;
            Response.Write(ds.Tables[0].Rows[0][1]);
            br.Close();
            br.Dispose();
    ����Ҫ�ѽ����ⲿ��ת��delphi��,�����?
      

  3.   

    不好意思,我是这两天才接触这些东西的,看不懂那个帖子.
    这是 c# 中的代码:
    编码:
    DataSet ds;
            ds = DbTools.GetDS("select * from D_Users", "D_Users");
            MemoryStream s = new MemoryStream();
            //BinaryFormatter bf = new BinaryFormatter();
            SoapFormatter sf = new SoapFormatter();
            sf.Serialize(s, ds);
            //bf.Serialize(s, ds);
            byte[] e = s.ToArray();
            return e;
            s.Close();
            s.Dispose(); 
    解码:
            localhost.returnbyte returnbyte = new localhost.returnbyte();
            byte[] resultbyte = returnbyte.SurrogateRead();
            MemoryStream br = new MemoryStream(resultbyte);
           // BinaryFormatter bf = new BinaryFormatter();
            SoapFormatter sf = new SoapFormatter();
            object obj = sf.Deserialize(br); 
            DataSet ds = new DataSet();
            ds = (DataSet)obj;
            Response.Write(ds.Tables[0].Rows[0][1]);
            br.Close();
            br.Dispose();
    我需要把解码这部分转成delphi的,如何做?