HighTechTalks DotNet Forums  

<<Urgent>> HttpModule, WebService

ASP.net Web Services microsoft.public.dotnet.framework.aspnet.webservices


Discuss <<Urgent>> HttpModule, WebService in the ASP.net Web Services forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default <<Urgent>> HttpModule, WebService - 08-25-2003 , 09:21 AM






Hi,
I have a DLL that does something with the network interface. When My
Web Service receives a request, a function of this DLL will be called,
and after the data has been sent to the client, another function will
be called. So it is important to know, when the data has been already
sent.
For the first situation it is not a problem bec a request will be
received, but the problem is in the second case
So I thought, an HttpModule may help, and here is some code:

---------------
Global.asax
---------------
<%@ Application Codebehind="Global.asax.cs" Inherits="ModuleWS.Global"
%>

-------------------
Global.asax.cs
-------------------
protected void Application_EndRequest(Object sender, EventArgs e)
{
HttpApplication httpApp = (HttpApplication) sender;
httpApp.Response.Flush();
//while(httpApp.Response.IsClientConnected)
//the client is always connected until it gets all traffic,
// that is logical, so this will not return
while(httpApp.Response.OutputStream.Length > 0)
{
//System.Threading.Thread.Sleep(20);
}
}
-------------------------------------------------------------------------------

when I include this, the client will break down, bec. it doesn't
receive any answer. Any ideas??? even when u have another solution, I
need a way that tells me that the WebService has sent the data to the
client.
Thanx

Reply With Quote
  #2  
Old   
Frank Drebin
 
Posts: n/a

Default Re: <<Urgent>> HttpModule, WebService - 08-25-2003 , 03:06 PM






It seems you still want to keep things very transactional - even at this
higher (application level).

You could make the client so that it sends a response back to the server
when it has acknowledged what you sent.. so:

Caller->Server: "Gimme data"
Server: AddFilter
Server->Caller: Return "data"
Caller->Server: Ack Data - thanks!
Server. RemoveFilter

What about that?


"NET_NET_2003" <NET_NET_2003 (AT) hotmail (DOT) com> wrote

Quote:
first, thanx for ur participation

I have a DLL, with which I can create filters in my network card to
perform some tasks on the packets leaving.
When a request arrives to my Web Service,the Web Service(or Module, or
somebody else) calls the "Create_filter" function of this DLL, and
after the request has been sent, Web Service (or Module, or somebody
else) must remove this filter calling "Remove_filter" function of the
DLL.

Creating is no problem (event BeginRequest), but I can't remove the
filter when the event EndRequest is fired because the stream is still
in the above layer, i.e. data has not been (maybe not compeletly)
sent. I need to know, that data is out.

Thanx


"Frank Drebin" <noemail (AT) imsickofspam (DOT) com> wrote

I'm not clear on what you said, let me see if I can recap:

-a client attaches to your webservice
-the web service returns data
-you need to do something useful when the web service finishes returning
the
data?

If so - in the WebMethod, why not put your code in there?

"NET_NET_2003" <NET_NET_2003 (AT) hotmail (DOT) com> wrote in message
news:526ed31c.0308250621.f9ef2c (AT) posting (DOT) google.com...



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.