473,895 Members | 2,500 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Stream not readable problem


I got a 'stream not readable' exception. I'd appreciate if some one can tell
me how i can overcome this.

My Exception
An unhandled exception of type 'System.Web.Ser vices.Protocols .SoapException'
occurred in system.web.serv ices.dll

Additional information: System.Web.Serv ices.Protocols. SoapException: Server
was unable to process request. ---> System.Argument Exception: Stream was not
at System.IO.Strea mReader..ctor(S tream stream, Encoding encoding, Boolean
detectEncodingF romByteOrderMar ks, Int32 bufferSize)
at System.IO.Strea mReader..ctor(S tream stream)
at WebService1.Ser vice1.GetCompre ssedData() in
c:\inetpub\wwwr oot\webservice1 \service1.asmx. cs:line 114
--- End of inner exception stack trace ---

My code
public string GetCompressedDa ta()
TextReader textreader;
DataSet ds = new DataSet();

// populate dataset

byte[] bytes = System.Text.Enc oding.UTF8.GetB ytes(ds.GetXml( ));

// compress using
using(MemoryStr eam sourcestream = new MemoryStream(by tes))
MemoryStream destinationStre am = new MemoryStream();
using (XceedCompresse dStream xcs =
XceedCompressed Stream(destinat ionStream))
byte[] buffer = new byte[ 32768 ];
int bytesRead = 0;

while( ( bytesRead = sourcestream.Re ad( buffer, 0, buffer.Length ) )
0 )

xcs.Write( buffer, 0, bytesRead );
textreader = new StreamReader(de stinationStream ); // **** line 114 ****
return textreader.Read ToEnd();
Jul 19 '05 #1
0 5936

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

Similar topics

by: Alfred | last post by:
I just write a problem. It use 5 threads to set value in the buffer value and 5 threads to get the buffer value. The buffer only can handle 3 array. The buffer is in the server side, and the 10 threads is the client side. when I execute 10 stream socket threads in one main method, it will set value in the buffer, over 3 it will wait... The problem is here, I need to use the other 5 thread to get the buffer value, then free the buffer,...
by: dbuser | last post by:
Hi, I have to implement every even and odd character swapping of a stream. My problem is with the following code is that if the stream has total even no of characters in it(including spaces) then it works, but when it has odd no of characters, then last characters is not written , because it does not have i+1 element to swap. Here is what I am doing: Please suggest the correct way of doing this for any number of character. void swap(...
by: Ryan Ternier | last post by:
I'm writing a file out using StreamWriter. What i'm outputting is a 6,398 lines of stupid Jscript arrays. Yes the system needs to be very very dynamic, and they don't want a page reload. The arrays are so huge because the program needs: Take table 1, and join each row in table 1 to X rows in Table 2. Take each row in table 2 and assign it to X rows in table 3. Take each row in table 3 and assign it to X rows in table 4... and so on....
by: Jack Russell | last post by:
Stream reader Readline returns "Nothing" if at the end of the stream. However it also seems to return nothing if it comes across a line with nothing in it (just a CR). Is there any way of telling the difference Jack Russell
by: hs | last post by:
Hi I got a 'stream not readable' exception. I'd appreciate if some one can tell me how i can overcome this. thanks My Exception --------------
by: noone | last post by:
I have what I believe is a common problem. I must pull protocol messages in from a data stream and save them as subclassed objects. the messages vary in length and only share a fixed length header of common format. consider: struct message {} struct m_reset: public message {}
by: Nobody | last post by:
I'm trying to put together code to deal with a SOAP with attachements response, and I'd like to process the response in a single pass. The SOAP with attachments specification returns XML in a MIME message, so it looks like this: --4389012.48390 Content-Type: text/xml <?xml version="1.0" encoding="UTF-8"?> <soap-env:Envelope
by: =?Utf-8?B?TWFya3VzU3Ryb2Js?= | last post by:
Hi all! I'm currently developing a file upload and download server using WCF using the streamed transfer mode. When i download a file i open a FileStream on the server side and pass it to the client. The client reads the data out of the stream and closes the stream. The problem is that the serverside file still stays locked after the operation finished (consecutive tries to delete the file fail with a "...
by: fevos | last post by:
Hi i want to record voice and send it throw Bluetooth stream , the problem is the recorder accepts only I.O Stream And write at the 'stream' without using (stream.write), ''using openNETCF Dim Stream1 As Stream Stream1 = File.OpenWrite("\My Documents\" & txtFileName.Text & ".wav") m_Recorder = New OpenNETCF.Media.WaveAudio.Recorder m_Recorder.RecordFor(Stream1, 5400,OpenNETCF.Media.WaveAudio.SoundFormats.Stereo16bit11kHz) ''...
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.