技术开发 频道

WinCE数据通讯之Web Service篇

  添加WebService服务

        //方法二:返回 DataSet 对象用序列化后的byte[]字节数组
        [WebMethod(Description = "返回 DataSet 对象用序列化后的byte[]字节数组。")]
        
public byte[] GetDataSetBytes()
        {
            DataSet dataSet
= GetNorthwindDataSet();
            
return ComZipClass.zip.byteXmlSerializer(dataSet);
        }

        
//方法三返回 DataSet对象用序列化并Bzip压缩后的byte[]字节数组
        [WebMethod(Description = "返回 DataSet对象用序列化并Bzip压缩后的byte[]字节数组。")]
        
public byte[] GetBZiipCompress()
        {
            DataSet dataSet
= GetNorthwindDataSet();
            
byte[] ser = ComZipClass.zip.byteXmlSerializer(dataSet);
            
byte[] zip = ComZipClass.zip.BZipCompress(ser);
            
return zip;
        }
        [WebMethod(Description
= "返回Deflater压缩")]
        
public byte[] GetDeflaterCompress()
        {
            DataSet dataSet
= GetNorthwindDataSet();
            
byte[] ser = ComZipClass.zip.byteXmlSerializer(dataSet);
            
//byte[] ser = ZipClass.zip.byteXmlSerializer(dataSet);
            byte[] zip = ComZipClass.zip.DeflaterCompress(ser);
            
return zip;
        }
        [WebMethod(Description
= "返回Gzip压缩")]
        
public byte[] GetGZipCompress()
        {
            DataSet dataSet
= GetNorthwindDataSet();
            
byte[] ser = ComZipClass.zip.byteXmlSerializer(dataSet);
            
byte[] zip = ComZipClass.zip.GZipCompress(ser);
            
return zip;
        }
        [WebMethod(Description
= "返回Zip压缩")]
        
public byte[] GetZipCompress()
        {
            DataSet dataSet
= GetNorthwindDataSet();
            
byte[] ser = ComZipClass.zip.byteXmlSerializer(dataSet);
            
byte[] zip = ComZipClass.zip.ZipCompress(ser);
            
return zip;
        }
0
相关文章