473,735 Members | 6,432 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2290
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********@joer gjooss.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
4624
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 like 8< tr1ff8> or
6
3943
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 have "Hi" in database, i will have &quot;Hi&quot; in content of element. And it is ok, because in xml does not exist ", at least i think that. After it i want to make convert from document to string. I used XMLOutputter serializer = new...
12
6557
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 courses to pass the correct option value and then be displayed at the following URL: http://www.dslextreme.com/users/kevinlyons/selectResults.html I am passing countries, products, and courses. The first two display
16
2906
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 loaded into cache, the slideshow doesn't look very nice. I am not sure how/when to call the slideshow() function to make sure it starts after the preload has been completed.
15
4775
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 button will verify the information that has been entered and updates the data base if the data is correct. Update will throw an exception if the data is not validate based on some given rules. I also have a custom error handling page to show the...
7
4260
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" value="Merchant Name"> <input type="hidden" name="OrderID" value="Unique OrderID value"> <input type="hidden" name="email" value="Customers email address (OPTIONAL)">
3
2882
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 of the browser, including handling cookies, automated logins & following multiple web-link paths. Multiple threading would be a plus but not requirement. Some solutions were suggested: Perl:
11
2783
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 < or several others, it converts them to html, such as &amp; or &lt; which can sometimes cause my scripts not to work. How can I prevent ASP.NET from doing this? Thanks. -- Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/
0
2549
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... #!usr/bin/perl -w use strict; use LWP; use LWP::Simple; use LWP::UserAgent; use HTML::Form; use Switch; use HTTP::Cookies;
0
8962
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
9327
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
9251
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
9200
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
6049
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();...
0
4822
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3273
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
2
2739
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2188
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.