473,748 Members | 10,889 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Modifying a HttpModule Request.Filter

Hi,

I've a webservice that has several typical webmethods that clients
call and get responses from.

(Side note: The websriivce is actually to implement the server side of
tr-069, the protocol is somewhat funny in that the server can send
arbitrary requests to the client in the RESPONSES to calls to its
webmethods)

When a client has finished calling methods and processing responses to
those requests it notifies the server that the server can start
sending arbitrary requests in its method Responses. The client
notifies the server of this situation by posting an EMPTY request to
the web service's .asmx

ie:

POST /Webservices/ACS/Service.asmx HTTP/1.1
Host: 10.1.83.36:80
User-Agent: GS_TR69_CPE-0.2
Connection: keep-alive
Cookie: ASP.NET_Session Id=pngyu45521cu ww45vb4px0ax
Content-Type: text/xml
Content-Length: 0

What I need to do is find some way to have this post call a predefined
"EmptyReque st" webmethod in the service (this will also get session
info into context free of charge).

SoapExtensions wont work because there isn't enough information in the
post to allow an appropriate webmethod to be selected.

Currently I have a HttpModule that hooks BeginRequest and adds a
filter to the HttpContext.Cur rent.Request.Fi lter.

The intention is to have the filter return a canned piece of well
formed SOAP/XML that causes the predefined EmptyRequest method to
fire.

All this (almost) works: Provided the Content-Length is >= 1 the
filter is Read from and it can return the appropriate XML and alter
the size correctly. So I can make it that any incoming request is
hijacked and causes the EmptyRequest method to fire.

However, when the HttpContext.Cur rent.Request.Co ntentLength = 0 the
filter is _never_ read from .. so the approach fails.

Any ideas how the ContentLength = 0 can be fixed or another .net
approach that would neatly resolve this? (Preferably, I'd like to stay
away from Isapi filters)

Regards,

Mike.

May 10 '07 #1
0 2878

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

Similar topics

0
946
by: Peter Row | last post by:
Hi, Just in case anyone else has the following issue (unlikely but you never know) here is the solution I eventually found after I was threatening myself with a wipe and reload of my laptop. VB6 to VB.NET web project Port. We wanted all the code to run under .NET However we use an ISAPI filter. According to posts my Microsoft bods it is not possible to write these in .NET.
1
1655
by: Ryan Cromwell | last post by:
I have written an httpModule for use in our test environment. If a user goes to http://testserver/SomeApplication/MyPage.aspx it will resolve to the latest version of that application deployed: http://testserver/SomeApplication.1.0.10.0/MyPage.aspx, for instance. Problem is, the httpModule doesn't get called because http://testserver/SomeApplication doesn't exist. I assume this is because IIS is spitting it back, but I am not sure. ...
4
1810
by: Thomas | last post by:
I want to be able to implement a filter that manipulates the output from the server... Maybe replacing some words, or highlighting a search string, or some other fancy feature... I want to make this code reusable to all my applications, and by making this as a HttpModule I can implement this feature on existing .Net applications by editing the we.config and nothing else... My problem is that that I can't get this to work.
7
4145
by: Shapiro | last post by:
I have a scenario where I log a resquest to a database table and update the request with a corresponding response including the response time. I am using an HttpModule to do this. My challenge is how to corelate the response to a corresponding request. I am looking for a sure proof threadsafe way to corelate a response to a coresponding request message. Two things that concerns me:-
3
2883
by: Adam | last post by:
Its my understanding that in asp.net 2.0 you can write an httpmodule that will acts as a wildcard handler and pass requests on to the proper engine, for instance, asp or perl for example, In the past I believe if it wasn't an aspx file, things didnt work right. Can anyone provide input if this really is the case now?
1
2042
by: nsyforce | last post by:
Can you change the domain name in an HTTPModule? I have seen examples of changing the relative url in an HTTP Module, such as the following: protected void AuthenticateRequest(object sender, EventArgs e) { HttpApplication app = (HttpApplication) sender; HttpContext objContext = (HttpContext) app.Context; objContext.RewritePath("mynewpage.aspx"); } However, I'd like to take a request from
0
1119
by: Tom | last post by:
Hi, I try to modify the request stream of the HttpApplication object. I work with a request filter, thus I implemented the Stream class at the derived class. In the BeginRequest event handler of the implemented IHttpModule interface. I install the filter here. With the following statement: app.Request.Filter = new myFilter(app.Request.Filter);
2
4586
by: walter | last post by:
Hi there, I know there is pool of HttpApplications, and for each request coming in, HttpRuntime will dedicate one from pool to serve the request. My questions are : 1. since HttpModule is plug into the process, does each instance of HttpApplication keep its own set of HttpModule instance or HttpModules are shared among all HttpApplication instances? 2. In case of HttpApplication keep its own set of HttpModule, does the HttpModule...
2
1969
by: Sheila | last post by:
Hi, I have setup a Sharepoint 2003 server which has an ISAPi filter installed, now I want to develop a HTTPModule which needs to run before the ISAPI filter. So my question is, if a HTTPModule and an ISAPI filter are installed on the same web virtual directory, which one will process first? Thanks in advance.
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8830
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,...
1
9321
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,...
0
6074
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4602
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...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3312
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
2
2782
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
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 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.