473,385 Members | 1,927 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,385 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 6422
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...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.