473,387 Members | 1,592 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,387 software developers and data experts.

New to ASP.NET and IIS Question

BM
Hello,

Ok, Im new to using ASP.NET and IIS so im not sure how or where to post this
question but here goes:

I am running IIS 5.1 on WinXP. I need to process http POST messages sent
from another application that I dont have control over. The messages are
sent to a web page called test.htm . The message looks similiar to the
following:

data "POST /test.htm HTTP/1.0
Content-Type: application/x-www-form-urlencoded
Content-Length: 101

status=02%2F01%2F04%2023%3A21%20TEST MESSAGE%20HELLO% A%0D%0A"

The question is since this is being sent to a .htm page can I get these
messages and somehow process these using ASP.NET. I dont have control over
that it goes to test.htm (instead of test.aspx).

With a windows form I have been able to open a socket connection and read
these messages live and create files, databases etc, but with IIS involved
on the same machine it locks that port (80) and would be nice if I could use
ASP.NET to process these.

Thanks..
BM
Nov 18 '05 #1
4 1222
its a standard web form post. the data is in form field "status". the only
trick you need to do is map the .htm extension to asp.net processing for
your application (application properties tab of iis), and the following will
work

test.htm >>>
<%@ Page Language="c#" %>
<%
Response.Write("You sent:" + Request.Form["status"].Value);
%>
-- bruce (sqlwork.com)


"BM" <bl**@blah.com> wrote in message
news:#E**************@TK2MSFTNGP11.phx.gbl...
Hello,

Ok, Im new to using ASP.NET and IIS so im not sure how or where to post this question but here goes:

I am running IIS 5.1 on WinXP. I need to process http POST messages sent
from another application that I dont have control over. The messages are
sent to a web page called test.htm . The message looks similiar to the
following:

data "POST /test.htm HTTP/1.0
Content-Type: application/x-www-form-urlencoded
Content-Length: 101

status=02%2F01%2F04%2023%3A21%20TEST MESSAGE%20HELLO% A%0D%0A"

The question is since this is being sent to a .htm page can I get these
messages and somehow process these using ASP.NET. I dont have control over that it goes to test.htm (instead of test.aspx).

With a windows form I have been able to open a socket connection and read
these messages live and create files, databases etc, but with IIS involved
on the same machine it locks that port (80) and would be nice if I could use ASP.NET to process these.

Thanks..
BM

Nov 18 '05 #2
BM
Bruce,

Thanks for your help. The information about the mapping of IIS works fine
for telling asp.net to work on .htm files correctly. I verified this with a
test application by renaming an .aspx file to .htm and that works fine for
web page browsing and messages intstigated by loading the test.htm page.

The issue that I still seem to have and dont fully understand what to do is:
This application that sends Post messages is not using a web form or any
form whatsoever. It is sending the Post message as I have shown to the .htm
page which I want take and parse and save into a file. I guess im still to
new to understand how these messages work as I come from a non web
background.

Im sure Im just missing something simple. Im placing my streamwriter code
in the page_load event as that is the only place I see where a post message
is handled. This may be my big mistake as the page is never really loaded,
Post messages are just sent to it. Is there an event which just receives
the Post message?

I have created a sample code-behind web application which writes to a test
output file to see if it everything is fine. When I use a browser to access
the test.htm page it responds correctly in the IIS log with a 200 message
and writes to my log with my debug strings as the page_load is probably
responding to the event. When I actually use the real application which is
sending the post messages without web forms the server log shows 405 which I
know is not good. Im stumped as what to do..

Thanks for any Help you can provide!

BM/

"bruce barker" <no***********@safeco.com> wrote in message
news:ee**************@TK2MSFTNGP10.phx.gbl...
its a standard web form post. the data is in form field "status". the only
trick you need to do is map the .htm extension to asp.net processing for
your application (application properties tab of iis), and the following will work

test.htm >>>
<%@ Page Language="c#" %>
<%
Response.Write("You sent:" + Request.Form["status"].Value);
%>
-- bruce (sqlwork.com)


"BM" <bl**@blah.com> wrote in message
news:#E**************@TK2MSFTNGP11.phx.gbl...
Hello,

Ok, Im new to using ASP.NET and IIS so im not sure how or where to post

this
question but here goes:

I am running IIS 5.1 on WinXP. I need to process http POST messages sent from another application that I dont have control over. The messages are sent to a web page called test.htm . The message looks similiar to the
following:

data "POST /test.htm HTTP/1.0
Content-Type: application/x-www-form-urlencoded
Content-Length: 101

status=02%2F01%2F04%2023%3A21%20TEST MESSAGE%20HELLO% A%0D%0A"

The question is since this is being sent to a .htm page can I get these
messages and somehow process these using ASP.NET. I dont have control

over
that it goes to test.htm (instead of test.aspx).

With a windows form I have been able to open a socket connection and read these messages live and create files, databases etc, but with IIS involved on the same machine it locks that port (80) and would be nice if I could

use
ASP.NET to process these.

Thanks..
BM


Nov 18 '05 #3
Hi BM,
Thanks for posting in the community!
From your description, you're wanting to manually send a post message to a
certain web page on a IIS server and also you'd like it to be processed by
ASP.NET runtime, yes?
If there is anything I misunderstood, please feel free to let me know.

I've reviewed the former messages and found that you've tried the Bruce's
suggestion and that worked well when you try visit the page via IE or other
browser but failed when you used other means to post it,yes? As for this
problem, I'd like to asked some further questions on it:
1. What component do you use to post a certain http post message?

2. What operations do you actually want to do in that certain webpage which
you'd like it to be processed by aspnet? Would you generate a simple sample
page and show use the detailed content(code logic) of it?

In addition, in ASP.NET you can also use the HTTPHandler to process a
certain type of http request. As for your situation, you can provide a
custom httphandler, for more information on developing a ASP.NET
HttpHandler, you may have a view on the following references:

#HttpHandlers
http://msdn.microsoft.com/library/en...handlers.asp?f
rame=true

#Inside IIS & ASP.NET
http://www.theserverside.net/article...aspx?l=IIS_ASP

# Extending ASP.NET with HttpHandlers and HttpModules
http://www.devx.com/dotnet/Article/6962/0/page/3

#Exploring ASP.NET Session State and Cache data
http://www.codeproject.com/aspnet/ex...onandcache.asp

Please check out the above suggestions and items. If you find any problems,
please feel free to post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #4
BM
Ahh!

This is what I was looking for: The HTTPHandler will solve my problem
exactly!

Thanks Steven.

BM

"Steven Cheng[MSFT]" <v-******@online.microsoft.com> wrote in message
news:1y**************@cpmsftngxa07.phx.gbl...
Hi BM,
Thanks for posting in the community!
From your description, you're wanting to manually send a post message to a
certain web page on a IIS server and also you'd like it to be processed by
ASP.NET runtime, yes?
If there is anything I misunderstood, please feel free to let me know.

I've reviewed the former messages and found that you've tried the Bruce's
suggestion and that worked well when you try visit the page via IE or other browser but failed when you used other means to post it,yes? As for this
problem, I'd like to asked some further questions on it:
1. What component do you use to post a certain http post message?

2. What operations do you actually want to do in that certain webpage which you'd like it to be processed by aspnet? Would you generate a simple sample page and show use the detailed content(code logic) of it?

In addition, in ASP.NET you can also use the HTTPHandler to process a
certain type of http request. As for your situation, you can provide a
custom httphandler, for more information on developing a ASP.NET
HttpHandler, you may have a view on the following references:

#HttpHandlers
http://msdn.microsoft.com/library/en...handlers.asp?f rame=true

#Inside IIS & ASP.NET
http://www.theserverside.net/article...aspx?l=IIS_ASP

# Extending ASP.NET with HttpHandlers and HttpModules
http://www.devx.com/dotnet/Article/6962/0/page/3

#Exploring ASP.NET Session State and Cache data
http://www.codeproject.com/aspnet/ex...onandcache.asp

Please check out the above suggestions and items. If you find any problems, please feel free to post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #5

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

Similar topics

1
by: Mohammed Mazid | last post by:
Can anyone please help me on how to move to the next and previous question? Here is a snippet of my code: Private Sub cmdNext_Click() End Sub Private Sub cmdPrevious_Click() showrecord
3
by: Stevey | last post by:
I have the following XML file... <?xml version="1.0"?> <animals> <animal> <name>Tiger</name> <questions> <question index="0">true</question> <question index="1">true</question> </questions>
7
by: nospam | last post by:
Ok, 3rd or is it the 4th time I have asked this question on Partial Types, so, since it seems to me that Partial Types is still in the design or development stages at Microsoft, I am going to ask...
3
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table...
10
by: glenn | last post by:
I am use to programming in php and the way session and post vars are past from fields on one page through to the post page automatically where I can get to their values easily to write to a...
10
by: Rider | last post by:
Hi, simple(?) question about asp.net configuration.. I've installed ASP.NET 2.0 QuickStart Sample successfully. But, When I'm first start application the follow message shown. ========= Server...
53
by: Jeff | last post by:
In the function below, can size ever be 0 (zero)? char *clc_strdup(const char * CLC_RESTRICT s) { size_t size; char *p; clc_assert_not_null(clc_strdup, s); size = strlen(s) + 1;
56
by: spibou | last post by:
In the statement "a *= expression" is expression assumed to be parenthesized ? For example if I write "a *= b+c" is this the same as "a = a * (b+c)" or "a = a * b+c" ?
2
by: Allan Ebdrup | last post by:
Hi, I'm trying to render a Matrix question in my ASP.Net 2.0 page, A matrix question is a question where you have several options that can all be rated according to several possible ratings (from...
3
by: Zhang Weiwu | last post by:
Hello! I wrote this: ..required-question p:after { content: "*"; } Corresponding HTML: <div class="required-question"><p>Question Text</p><input /></div> <div...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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
Oralloy
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,...
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.