473,804 Members | 3,057 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Programatically Build and Post Form

Hello All:

I've got, what appears to be a simple problem, but am having a brain cramp
on determining the best way to implement. Here is the requirement (I am using
ASP.net v1.1)

User enters information in web form (OK)
User submits form (OK)
On form submission, parse data and store as XML to a file on the server (OK)
Automatically send the XML file to a remote server as an HTTP POST (Problem)

I've investigated the HTTP Response object and haven't found the right way
of capturing the XML file, applying the HTTP Header, and Posting this to the
external page. Creating the text string w/
<Form...MimeTyp e=multipart/form-data... Input Type=File... etc is not a
problem. The problem is how to take this string and stream it to the
appropriate location.

Thanks for any help you can provide.

Tom
Jul 21 '05 #1
3 2662
Hi Tom,

Based on your description, you 're wanting to programly send a xml file to
a remote site?

Regardless of the former three items you mentioned below:
=============== =============== =========
User enters information in web form (OK)
User submits form (OK)
On form submission, parse data and store as XML to a file on the server (OK)
Automatically send the XML file to a remote server as an HTTP POST (Problem)
=============== =============== =========

Let's just focus on the 4th one

Automatically send the XML file to a remote server as an HTTP POST (Problem)

Is the remote server a certain server in your local enviorment , also is
there a certain service( asp.net page or isapi ) which will accept the post
request ( the file stream)? If there is a certain page, then we can use
the
System.Net.Http WebRequest class to do such task. Here is a certain tech
article discussing on this, you can have a look:

#UploadFileEx: C#'s WebClient.Uploa dFile with more functionality
http://www.thecodeproject.com/csharp...asp#xx972854xx

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.)


Jul 21 '05 #2
Hi Steve:

Thanks for your response.

The target is a remote URL from another company
The receiver is a Java Servlet
The client's requirement is that we encapsulate the XML document into a
<Form url=www.remotec ompany.servlet. com> and send via HTTP.
If I were manually testing, I could build a simple form with an <Input
Type=File> and place the address of the XML document inot the input.
Upon submit, an HTTP stream w/ the file would be sent to the client

My question is how to create this stream programatically without a form
interaction with a user.

Thanks again,

Tom

"Steven Cheng[MSFT]" wrote:
Hi Tom,

Based on your description, you 're wanting to programly send a xml file to
a remote site?

Regardless of the former three items you mentioned below:
=============== =============== =========
User enters information in web form (OK)
User submits form (OK)
On form submission, parse data and store as XML to a file on the server (OK)
Automatically send the XML file to a remote server as an HTTP POST (Problem)
=============== =============== =========

Let's just focus on the 4th one

Automatically send the XML file to a remote server as an HTTP POST (Problem)

Is the remote server a certain server in your local enviorment , also is
there a certain service( asp.net page or isapi ) which will accept the post
request ( the file stream)? If there is a certain page, then we can use
the
System.Net.Http WebRequest class to do such task. Here is a certain tech
article discussing on this, you can have a look:

#UploadFileEx: C#'s WebClient.Uploa dFile with more functionality
http://www.thecodeproject.com/csharp...asp#xx972854xx

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.)


Jul 21 '05 #3
Hi Tom,

Yes, I've got your requirement that it is how to programly make a HTTP post
(which send some post items and a file stream) just like the user submit a
certain page which some text field and file upload field.
Have you had a chance to check the article I provided in the last message,
it is just discussing simulate web page's post request via the .net's
HttpWebRequest component:

#UploadFileEx: C#'s WebClient.Uploa dFile with more functionality
http://www.thecodeproject.com/csharp...asp#xx972854xx

and here is a blog version of it.

http://blogs.ronaco.com/Blogs/rwilson/articles/174.aspx

If anything unclear on that , please feel free to let me know.

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.)

Jul 21 '05 #4

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

Similar topics

4
17259
by: Csaba2000 | last post by:
I want to be able to programatically click on the center of an <INPUT type=image ...> element (I only care about IE 5.5+). This should work regardless of whether IE has focus. Normally you would do myDomElement.click and the mouse doesn't matter, but in the case of an input image element, what happens is the submitted url has something like "?x=12&y=7" appended to it (the numbers vary per mouse position on the clicked element). If you hit...
3
3688
by: Scott M | last post by:
Hi, I am currently trying to write a simple game using vb.net the form I am working on is 800*600 (this is set as the maximum size) and autoscroll is set to true. The user moves around the screen by moving a picturebox (sprite) with the cursor keys. When the user hits the bottom of the screen I want the screen to automatically scroll down to keep the picture box in view - The screen
4
3893
by: Andrea Williams | last post by:
Does anyone know of some in depth documentation regarding how to add user controls programatically? I have a User Control, which has some basic html controls, and depending on the number selected in an HtmlSelect control's value, I need to put x number of forms (or usercontrol) on the page. I've added the control once to the ASPX, but how do I add more than one when needed to the page, then how do I rename the form names so that they are...
3
552
by: Tom Donohue | last post by:
Hello All: I've got, what appears to be a simple problem, but am having a brain cramp on determining the best way to implement. Here is the requirement (I am using ASP.net v1.1) User enters information in web form (OK) User submits form (OK) On form submission, parse data and store as XML to a file on the server (OK) Automatically send the XML file to a remote server as an HTTP POST (Problem)
6
3364
by: AppleBag | last post by:
I'm having the worst time trying to login to myspace through code. Can someone tell me how to do this? Please try it yourself before replying, only because I have asked this a couple of times in the past in other places, and while the help was much appreciated, it seemed everyone just wanted to 'theoretically' explain how to do it, but when I tried to do it myself, I couldn't login. I want to simply pass the email address and password to...
1
2883
by: Grey Alien | last post by:
Apologies for the cross post. I am quite desperate and do not know which ng would be the most appropriate. I am trying to programatically POST an ASP form, to allow me to log on to a site programatically. <form name="aspnetForm" method="post" action="Default.aspx" id="aspnetForm"> <input name="_ct99:Content:UsrName" type="text" id="_ct99_Content_UsrName" />
2
2100
by: Grey Alien | last post by:
I am trying to programatically POST an ASP form, to allow me to log on to a site programatically. <form name="aspnetForm" method="post" action="Default.aspx" id="aspnetForm"> <input name="_ct99:Content:UsrName" type="text" id="_ct99_Content_UsrName" /> <input name="_ct99:Content:Pwd" type="password" id="_ct99_Content_Pwd" /> <input type="submit" name="_ct99:Content:btnLogon" value="Logon"
0
977
by: hikmaverick | last post by:
Hi all, the title of my topic is a copy from an old message posted by Grey Allen, about twenty days ago. As Grey, I am trying to programatically POST an ASP form, to allow me to log on to a site programatically. It is exactly the same problem. The code, I've written in Java, works for php, etc.., but not for ASP pages. The reply that Grey got to his message was: "if this is a asp.net site, you need to also send the __VIEWSTATE with...
3
4236
by: =?Utf-8?B?UGF1bA==?= | last post by:
I need to programatically upload a text file to a web server using the HTTPWebRequest object within .Net 2.0. So far, I have determined that: - I need a HTTP content-type of "multipart/form-data". - I need to use the ContentType.Boundary property. That is about as far as I have gotten.
0
9706
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
10583
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...
1
10323
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
10082
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
9160
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7622
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6854
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();...
2
3822
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2995
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.