views:

48

answers:

4

I am building a website, within a large intranet, that wraps and adds functionality to another site within the same intranet. I do not have access to the other site's source and they do not provide any api's for the functionality they provide. I need to, somehow, have my server-side code go to that site, fill in some forms, then press a submit button.

Is this possible? If so, how can I accomplish this?


Note: I am working in asp.NET if that matters at all.

+2  A: 

Not the most efficient, but maybe WatiN can get you started:

http://watin.sourceforge.net/

Ian P
A: 

Search for HttpWebRequest

matt-dot-net
+2  A: 

Just look at the URL the form is supposed to submit to and the method it employs (POST or GET) and then send a request to that URL using the same method and put the field you want as parameters

Gab Royer
Of course this wont trigger any javascript there might be.
Gab Royer
A: 

Your server-side code is basically a web client to the other web site. You will need to write the code to send the HTML form data to the other web site and process the response. I would start with the System.Net.WebClient class. Take a look at System.Net.WebClient.UploadValues. That class/method will enable you to POST the form data to the web site via a NameValueCollection.

Dan Mork