473,569 Members | 2,422 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Windows Service Stream issue

Hi,

I have some code that uses HttpWebRequest to request data from an
Internet site, performaing a "screen-scraping" of an html page textual
data. I then use the HttpWebResponse .GetResponseStr eam() to retrieve
the data as a stream.

I put this stream into a MemoryStream, and I use a StreamReader object
to read the contents and write to a temp file on the local system.

I have this code within a C# class that if I call the method from a
windows application form, successfully runs to completion and retrieves
all the data from the html web page. But if I put this as part of a
Windows service, the data retrieved gets cut-off, consistently at the
same point. This leads me to believe it's a buffer size issue, but
increasing the memorystream buffer size does not impact?

Why does the same code run as a Service and through a windows form have
different results? Is there some limitations of using streams in a
windows Service?

Thanks for your help.

CJ

Dec 22 '05 #1
1 1217
How do you retrieve data from ResponseStream?

Are there any errors, when your data is being "cut-off"?

Enable Network Tracing in order to see if the data was received by you.

--
Vadym Stetsyak aka Vadmyst
http://vadmyst.blogspot.com

<cj*********@ho tmail.com> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .
Hi,

I have some code that uses HttpWebRequest to request data from an
Internet site, performaing a "screen-scraping" of an html page textual
data. I then use the HttpWebResponse .GetResponseStr eam() to retrieve
the data as a stream.

I put this stream into a MemoryStream, and I use a StreamReader object
to read the contents and write to a temp file on the local system.

I have this code within a C# class that if I call the method from a
windows application form, successfully runs to completion and retrieves
all the data from the html web page. But if I put this as part of a
Windows service, the data retrieved gets cut-off, consistently at the
same point. This leads me to believe it's a buffer size issue, but
increasing the memorystream buffer size does not impact?

Why does the same code run as a Service and through a windows form have
different results? Is there some limitations of using streams in a
windows Service?

Thanks for your help.

CJ

Dec 22 '05 #2

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

Similar topics

2
3216
by: Bill | last post by:
I created a Windows Service (written in VB.NET) that uses a FileSystemWatcher to monitor a directory for file creation. When files with a certain extension are created in the directory, the file is opened and read (something is done with the contents). Then the file is moved to a backup directory. Everything works fine when the coe runs as a...
6
4657
by: FS Liu | last post by:
Hi, In my current ATL server project, I have to parse the input in the client application's request to find out the different combination of parameters, instead of using SOAP. For this reason, I am not using ATL server web service project. On client side, I use POST to send XML to web server. I know I should use ISAXXMLReader in the...
5
4259
by: vinoth | last post by:
Hi, I have created WindowsService Project.In that Project OnStart Method i have written the following Code. In this code the Server is waiting for the connection from client. When the Client connects to the Server, the server will process and send result to the client.(This is Client Server Application. The Server side Code is implementd...
0
2215
by: Charles Leonard | last post by:
I am having yet another issue with Windows Server 2003. This time, the web service (a file import web service) appears to run except for one odd message: "ActiveX component can't create object". There are no other statements to indicate what object cannot be created. Otherwise, everything on the test Windows Server 2003 works fine—all...
2
11115
by: Ankit Aneja | last post by:
I am making windows service using Microsoft visual studio.Net in C# service name is clamservice problem is that when i start the service it through control pannel->Administrative tools->services it shows "starting" and never shows "started" it goes somewhere in loop i am doing some logical mistake i want to create service supporting multiple...
5
5022
by: Peter Lapic | last post by:
I have to create a image web service that when it receives an imageid parameter it will return a gif image from a file that has been stored on the server. The client will be an asp.net web page that calls the web service to render a vertical strip of images. After doing some research I am unable to find some vb.net code that can assist...
3
2000
by: Jason Richmeier | last post by:
I looked for a more appropriate newsgroup for this question but I didn't see much of anything (something more specific to Windows Media Services). I have a server with Windows Media Services. When I try to establish an ASP ..NET application and open a page in this application, an attempt is made to open the page using Media Player (I am...
3
7041
by: Sylvie | last post by:
My Windows Application has two forms, one form contains a grid (lets say Stock Listing), and the other is a form of one stock, contains some edit boxes for one stock's fields.. Is it possible to run application remotely and retrieve grid and form data in some way without accessing directly to database server? Web Services is being used...
23
4967
by: Stewart Berman | last post by:
I am trying to develop a wrapper class for the Windows API functions in Visual Studio 2008: GetOpenFileName GetSaveFileName I put together a starter class: using System; using System.Collections.Generic; using System.Linq; using System.Text;
0
7618
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...
0
8132
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6286
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5222
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3656
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...
0
3644
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2116
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
0
944
bsmnconsultancy
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...

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.