大家好,我是新来的,最近在做一个delphi调用c#写的webservice的程序c#进行soap编码以后传给我,我怎么进行解码呀?如果做过类似的东东给点提示吧,我是刚接触这些东西的。这是 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的,如何做?
编码:
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的,如何做?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货