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

HTML Form posting & response parsing

Esa
Hi,

I'm having problems with one strange web system where submitting an
application and making queries about its handling status require a series of
form submits and response parsing - all in HTML. Luckily other interfaces
are "modern" using xml file up/downloads without any difficulties...

I'm not very used to .NET-environment yet, so I'd appreciate some clues
about the classes I should use to implement this stupid interface - stupid
because service user has to take part to bank's internal handling process by
posting some mid-handling-results back to the bank...And the best part was
that the bank's interface documentation just talked about submitting a form
and getting response form without a smallest word about these
redirections/reposts...

Basically the process goes like this:

0. I receive a xml-document and should return another xml-doc to the caller
after making the following queries with the bank.

1. I'll create my own initial html page and post it (https) to the other
server - no
problems here.

2. I get first response from the bank - either:

a) HTML-page with <META REFRESH...> redirection to another page (in case of
errors) - in this case I should get the error code from the next page for
further processing.

b) HTML-page containing a javascript function, a form with hidden fields and
a cookie that is required in further processing at the bank. That
js-function should be called to post the form back to another asp-page at
the bank's site (at least _currently_ it should be enough to just post that
form, but js-call is preferable). No values can be changed in this page, so
the task is just to get the form posted - I don't understand why this has to
made by me and not the bank automatically...

3. After submitting 2b form w/wo the javascript function either:

a) Same as 2a

b) Another HTML-page with hidden form fields with the final values I need to
update to the xml document before returning it to the caller.

I'm constrained to use .NET 1.1, and this function is most likely going to
be used in other programs too, but the first case is inside a message
transformation in BizTalk 2004 (this is the reason for 1.1 constraint).

I started testing with windows form application using WebBrowser control
just to get the content handling part started, but now I really need a hint.
Should I create my own hidden browser (with WebClient/Request etc). that
handles all the cookies, redirections and parses values from html and posts
them back to the bank. And what could be the easiest way to parse the
response html pages in this case.

Or can I somehow use (with .NET 1.1) a web browser like control (although
the final solution is not an application but a function to be used by other
programs) that handles cookies and redirections automatically and makes it
possible to call the javascript function on the bank's form.

I've already lost half my hair in the last two weeks with these undocumented
features I keep running into :-)

Thanks for all the answers in advance.

-- Esa
Mar 8 '06 #1
2 2235
Thus wrote Esa,
Hi,

I'm having problems with one strange web system where submitting an
application and making queries about its handling status require a
series of form submits and response parsing - all in HTML. Luckily
other interfaces are "modern" using xml file up/downloads without any
difficulties...

I'm not very used to .NET-environment yet, so I'd appreciate some
clues about the classes I should use to implement this stupid
interface - stupid because service user has to take part to bank's
internal handling process by posting some mid-handling-results back to
the bank...And the best part was that the bank's interface
documentation just talked about submitting a form and getting response
form without a smallest word about these redirections/reposts...

Basically the process goes like this:

0. I receive a xml-document and should return another xml-doc to the
caller after making the following queries with the bank.

1. I'll create my own initial html page and post it (https) to the
other
server - no
problems here.
2. I get first response from the bank - either:

a) HTML-page with <META REFRESH...> redirection to another page (in
case of errors) - in this case I should get the error code from the
next page for further processing.

b) HTML-page containing a javascript function, a form with hidden
fields and a cookie that is required in further processing at the
bank. That js-function should be called to post the form back to
another asp-page at the bank's site (at least _currently_ it should be
enough to just post that form, but js-call is preferable). No values
can be changed in this page, so the task is just to get the form
posted - I don't understand why this has to made by me and not the
bank automatically...

3. After submitting 2b form w/wo the javascript function either:

a) Same as 2a

b) Another HTML-page with hidden form fields with the final values I
need to update to the xml document before returning it to the caller.

I'm constrained to use .NET 1.1, and this function is most likely
going to be used in other programs too, but the first case is inside a
message transformation in BizTalk 2004 (this is the reason for 1.1
constraint).

I started testing with windows form application using WebBrowser
control just to get the content handling part started, but now I
really need a hint. Should I create my own hidden browser (with
WebClient/Request etc). that handles all the cookies, redirections and
parses values from html and posts them back to the bank. And what
could be the easiest way to parse the response html pages in this
case.


I don't think that a browser control will do you any good in a Biztal orchestration,
so HttpWebRequest is probably your best option.

Using a HTTP proxy like Fiddler, I would capture the traffic of a successful
workflow, and program a sequence of web requests that contain the same headers
and similar payload. This allows you to ignore client-side scripting -- all
you need to know is what is actually being transmitted.

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Mar 9 '06 #2
Esa
> I don't think that a browser control will do you any good in a Biztal
orchestration, so HttpWebRequest is probably your best option.
That's what I was afraid of... :)
Using a HTTP proxy like Fiddler, I would capture the traffic of a
successful workflow, and program a sequence of web requests that contain
the same headers and similar payload. This allows you to ignore
client-side scripting -- all you need to know is what is actually being
transmitted.


Thanks for the Fiddler hint, I'll make life a little bit easier.

I'll try to find some small HTML parser tool to help me with the response
HTML-page contents as I can't get them now from the WebBrowser control
directly.

-- Esa

-- Esa
Mar 10 '06 #3

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

Similar topics

3
by: zorro | last post by:
Hello there, I'm really stumped... I'm fetching a web page with a script and parsing it. There is a problem because the response inserts '8 1ff8' in random places. For example, I get things...
6
by: mali_djuro | last post by:
Hi all, i used JDOM to create XML file. first, i get data from database and create Document object. in some data i have quotas, so it makes replacment in content of elements. for example: if i...
12
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the...
16
by: Terry | last post by:
Hi, This is a newbie's question. I want to preload 4 images and only when all 4 images has been loaded into browser's cache, I want to start a slideshow() function. If images are not completed...
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
7
by: | last post by:
Hello, I would like to do the following from a asp.net button click: <form method="POST" action="https://www.1234.com/trans_center/gateway/direct.cgi"> <input type="hidden" name="Merchant"...
3
by: Sanjay Arora | last post by:
We are looking to select the language & toolset more suitable for a project that requires getting data from several web-sites in real- time....html parsing/scraping. It would require full emulation...
11
by: Nathan Sokalski | last post by:
I add several JavaScript events (onchange, onkeypress, etc.) to Controls using the Add method of the Attributes collection. However, if the JavaScript code contains certain characters, such as & or...
0
by: sharif | last post by:
Anyone could help me out for n=my code ......I have written following code ,Here i m able to get and post the form successfuly..but after posting im not gettng proper response content... ...
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:
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
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...

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.