473,394 Members | 2,168 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,394 software developers and data experts.

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...MimeType=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 2635
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.HttpWebRequest class to do such task. Here is a certain tech
article discussing on this, you can have a look:

#UploadFileEx: C#'s WebClient.UploadFile 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.remotecompany.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.HttpWebRequest class to do such task. Here is a certain tech
article discussing on this, you can have a look:

#UploadFileEx: C#'s WebClient.UploadFile 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.UploadFile 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
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...
3
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...
4
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...
3
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...
6
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...
1
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...
2
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...
0
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...
3
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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...

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.