473,796 Members | 2,488 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1239
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.co m> wrote in message
news:#E******** ******@TK2MSFTN GP11.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******** ******@TK2MSFTN GP10.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.co m> wrote in message
news:#E******** ******@TK2MSFTN GP11.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.m icrosoft.com> wrote in message
news:1y******** ******@cpmsftng xa07.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
3101
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
5044
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
2665
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 it differently. FOUR QUESTIONS: The background: I got three (3) files
3
3093
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 before rowID answID qryrow questionID datafield 1591 12 06e 06e 06e question 1593 12 06f 06f 06f question 1594 12 answer to the question 06f
10
3441
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 database or continue to process on to the next page. I am now trying to learn ASP to see if we can replace some of our applications that were written in php with an ASP alternative. However, after doing many searches on google and reading a couple...
10
3740
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 Error in '/QuickStartv20' Application. -------------------------------------------------------------------------------- Configuration Error Description: An error occurred during the processing of a configuration file
53
4096
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
4805
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
4285
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 less to more for example). I have a question object that has two properties that contain the collections Options and Ratings. now I want this kind of layout: --- Rating1 Rating2 Rating3 Option 1 () () ...
3
2554
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 class="not-required-question"><p>Question Text</p><input /></div>
0
9683
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
10457
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, 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...
0
10231
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10176
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
10013
tracyyun
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...
0
5443
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
5576
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4119
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
3
2927
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.