473,382 Members | 1,583 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

How to compress XML data that returns a webservice

Hi all,

I have made a webservice that returns an XML, but sometimes the connection
is so slow and there is a lot of data to be returned. I would like to know if
it is possible to send this data compressed, and how to do it.

Thanks.

Jose Luis.
Nov 23 '05 #1
8 6421
Hi,
Using System.IO.Compression namespace in .Net 2.0 you can achieve this.
Create the DeflateStream and pass the file's stream and set the compression
mode to Compress. See the below code to compress and decompress.

Compress :
outfile = New FileStream("test.xmd", FileMode.Create, FileAccess.Write)
DefStream = New DeflateStream(outfile, CompressionMode.Compress, False)
ds.WriteXml(DefStream)

DeCompress:
infile = New FileStream("test.xmd", FileMode.Open, FileAccess.Read)
DefStream = New DeflateStream(infile, CompressionMode.Decompress, False)
ds.ReadXml(DefStream)

Regards, Daya PSP India

"Jose L. Velazquez" wrote:
Hi all,

I have made a webservice that returns an XML, but sometimes the connection
is so slow and there is a lot of data to be returned. I would like to know if
it is possible to send this data compressed, and how to do it.

Thanks.

Jose Luis.

Nov 23 '05 #2
Hi,
Using System.IO.Compression namespace in .Net 2.0 you can achieve this.
Create the DeflateStream and pass the file's stream and set the compression
mode to Compress. See the below code to compress and decompress.

Compress :
outfile = New FileStream("test.xmd", FileMode.Create, FileAccess.Write)
DefStream = New DeflateStream(outfile, CompressionMode.Compress, False)
ds.WriteXml(DefStream)

DeCompress:
infile = New FileStream("test.xmd", FileMode.Open, FileAccess.Read)
DefStream = New DeflateStream(infile, CompressionMode.Decompress, False)
ds.ReadXml(DefStream)

Regards, Daya PSP India

"Jose L. Velazquez" wrote:
Hi all,

I have made a webservice that returns an XML, but sometimes the connection
is so slow and there is a lot of data to be returned. I would like to know if
it is possible to send this data compressed, and how to do it.

Thanks.

Jose Luis.

Nov 23 '05 #3
Hi Daya,

Thanks for your answer.

Actualy I am working with .Net 1.1, you know if working in .net 1.1 is
possible to do it?

Thanks.
Jose Luis.

"Daya PSP" wrote:
Hi,
Using System.IO.Compression namespace in .Net 2.0 you can achieve this.
Create the DeflateStream and pass the file's stream and set the compression
mode to Compress. See the below code to compress and decompress.

Compress :
outfile = New FileStream("test.xmd", FileMode.Create, FileAccess.Write)
DefStream = New DeflateStream(outfile, CompressionMode.Compress, False)
ds.WriteXml(DefStream)

DeCompress:
infile = New FileStream("test.xmd", FileMode.Open, FileAccess.Read)
DefStream = New DeflateStream(infile, CompressionMode.Decompress, False)
ds.ReadXml(DefStream)

Regards, Daya PSP India

"Jose L. Velazquez" wrote:
Hi all,

I have made a webservice that returns an XML, but sometimes the connection
is so slow and there is a lot of data to be returned. I would like to know if
it is possible to send this data compressed, and how to do it.

Thanks.

Jose Luis.

Nov 23 '05 #4
Hi Daya,

Thanks for your answer.

Actualy I am working with .Net 1.1, you know if working in .net 1.1 is
possible to do it?

Thanks.
Jose Luis.

"Daya PSP" wrote:
Hi,
Using System.IO.Compression namespace in .Net 2.0 you can achieve this.
Create the DeflateStream and pass the file's stream and set the compression
mode to Compress. See the below code to compress and decompress.

Compress :
outfile = New FileStream("test.xmd", FileMode.Create, FileAccess.Write)
DefStream = New DeflateStream(outfile, CompressionMode.Compress, False)
ds.WriteXml(DefStream)

DeCompress:
infile = New FileStream("test.xmd", FileMode.Open, FileAccess.Read)
DefStream = New DeflateStream(infile, CompressionMode.Decompress, False)
ds.ReadXml(DefStream)

Regards, Daya PSP India

"Jose L. Velazquez" wrote:
Hi all,

I have made a webservice that returns an XML, but sometimes the connection
is so slow and there is a lot of data to be returned. I would like to know if
it is possible to send this data compressed, and how to do it.

Thanks.

Jose Luis.

Nov 23 '05 #5
I use SharpZipLib and have no complaints:
http://www.icsharpcode.net/OpenSourc...b/Default.aspx

"Jose L. Velazquez" wrote:
Hi Daya,

Thanks for your answer.

Actualy I am working with .Net 1.1, you know if working in .net 1.1 is
possible to do it?

Thanks.
Jose Luis.

"Daya PSP" wrote:
Hi,
Using System.IO.Compression namespace in .Net 2.0 you can achieve this.
Create the DeflateStream and pass the file's stream and set the compression
mode to Compress. See the below code to compress and decompress.

Compress :
outfile = New FileStream("test.xmd", FileMode.Create, FileAccess.Write)
DefStream = New DeflateStream(outfile, CompressionMode.Compress, False)
ds.WriteXml(DefStream)

DeCompress:
infile = New FileStream("test.xmd", FileMode.Open, FileAccess.Read)
DefStream = New DeflateStream(infile, CompressionMode.Decompress, False)
ds.ReadXml(DefStream)

Regards, Daya PSP India

"Jose L. Velazquez" wrote:
Hi all,

I have made a webservice that returns an XML, but sometimes the connection
is so slow and there is a lot of data to be returned. I would like to know if
it is possible to send this data compressed, and how to do it.

Thanks.

Jose Luis.

Nov 23 '05 #6
I use SharpZipLib and have no complaints:
http://www.icsharpcode.net/OpenSourc...b/Default.aspx

"Jose L. Velazquez" wrote:
Hi Daya,

Thanks for your answer.

Actualy I am working with .Net 1.1, you know if working in .net 1.1 is
possible to do it?

Thanks.
Jose Luis.

"Daya PSP" wrote:
Hi,
Using System.IO.Compression namespace in .Net 2.0 you can achieve this.
Create the DeflateStream and pass the file's stream and set the compression
mode to Compress. See the below code to compress and decompress.

Compress :
outfile = New FileStream("test.xmd", FileMode.Create, FileAccess.Write)
DefStream = New DeflateStream(outfile, CompressionMode.Compress, False)
ds.WriteXml(DefStream)

DeCompress:
infile = New FileStream("test.xmd", FileMode.Open, FileAccess.Read)
DefStream = New DeflateStream(infile, CompressionMode.Decompress, False)
ds.ReadXml(DefStream)

Regards, Daya PSP India

"Jose L. Velazquez" wrote:
Hi all,

I have made a webservice that returns an XML, but sometimes the connection
is so slow and there is a lot of data to be returned. I would like to know if
it is possible to send this data compressed, and how to do it.

Thanks.

Jose Luis.

Nov 23 '05 #7
Thanks for your help

"serzsa" wrote:
I use SharpZipLib and have no complaints:
http://www.icsharpcode.net/OpenSourc...b/Default.aspx

"Jose L. Velazquez" wrote:
Hi Daya,

Thanks for your answer.

Actualy I am working with .Net 1.1, you know if working in .net 1.1 is
possible to do it?

Thanks.
Jose Luis.

"Daya PSP" wrote:
Hi,
Using System.IO.Compression namespace in .Net 2.0 you can achieve this.
Create the DeflateStream and pass the file's stream and set the compression
mode to Compress. See the below code to compress and decompress.

Compress :
outfile = New FileStream("test.xmd", FileMode.Create, FileAccess.Write)
DefStream = New DeflateStream(outfile, CompressionMode.Compress, False)
ds.WriteXml(DefStream)

DeCompress:
infile = New FileStream("test.xmd", FileMode.Open, FileAccess.Read)
DefStream = New DeflateStream(infile, CompressionMode.Decompress, False)
ds.ReadXml(DefStream)

Regards, Daya PSP India

"Jose L. Velazquez" wrote:

> Hi all,
>
> I have made a webservice that returns an XML, but sometimes the connection
> is so slow and there is a lot of data to be returned. I would like to know if
> it is possible to send this data compressed, and how to do it.
>
> Thanks.
>
> Jose Luis.

Nov 23 '05 #8
Thanks for your help

"serzsa" wrote:
I use SharpZipLib and have no complaints:
http://www.icsharpcode.net/OpenSourc...b/Default.aspx

"Jose L. Velazquez" wrote:
Hi Daya,

Thanks for your answer.

Actualy I am working with .Net 1.1, you know if working in .net 1.1 is
possible to do it?

Thanks.
Jose Luis.

"Daya PSP" wrote:
Hi,
Using System.IO.Compression namespace in .Net 2.0 you can achieve this.
Create the DeflateStream and pass the file's stream and set the compression
mode to Compress. See the below code to compress and decompress.

Compress :
outfile = New FileStream("test.xmd", FileMode.Create, FileAccess.Write)
DefStream = New DeflateStream(outfile, CompressionMode.Compress, False)
ds.WriteXml(DefStream)

DeCompress:
infile = New FileStream("test.xmd", FileMode.Open, FileAccess.Read)
DefStream = New DeflateStream(infile, CompressionMode.Decompress, False)
ds.ReadXml(DefStream)

Regards, Daya PSP India

"Jose L. Velazquez" wrote:

> Hi all,
>
> I have made a webservice that returns an XML, but sometimes the connection
> is so slow and there is a lot of data to be returned. I would like to know if
> it is possible to send this data compressed, and how to do it.
>
> Thanks.
>
> Jose Luis.

Nov 23 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Wencheng Magiya | last post by:
Hi all, My WebService connects to a database server, client application connects to the WebService. There is a backup method in WebService backups database and sends compressed data back to the...
6
by: Brad | last post by:
I have a web service which returns a collection of class object (see below). I want to consume this service in another web application by binding it to a List control The data returns from the...
2
by: headware | last post by:
I'm relatively new to ASP.NET and ADO.NET, but I have a basic design question regarding the use of web services and APS.NET applications. Right now we have an application that uses web services to...
4
by: Dan | last post by:
Hi, I pass datasets back and forth between client app and web services (hosted on iis 5). When written to xml file these datasets can be 500kb+. From a bandwitdth meter it seems this amount...
0
by: Jose L. Velazquez | last post by:
Hi all, I have made a webservice that returns an XML, but sometimes the connection is so slow and there is a lot of data to be returned. I would like to know if it is possible to send this data...
0
by: Srinivas Kotta | last post by:
Hi, I am Trying to get the Array of claases from Webservice which returns an array of classes. that webservice is returned in Java and i am consumin g that webservice in ASP.Net. my...
4
by: Daniel | last post by:
I've been asking around and reading but I cannot find a definitive answer. I have customers that need information from our calendar application. The data will come from SQL Server 2000. The...
6
by: Champika Nirosh | last post by:
Hi, I have two machine where I needed to have a extended TCP/IP protocol to make the link between the two machines Mean,I need to write a application that compress every data the machine send...
6
by: Peter | last post by:
I have a WebService which returns a List of RunningReport class How do I read this XML data on the client side. How do I convert List<RunningReportfrom the WebService side to List<RunningReporton...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.