|
-
Jun 12th, 2011, 12:44 PM
#1
Thread Starter
Junior Member
HTTP Headers
Hey,
I hope you will be able to help, as I have spent 10 hours so far with no success. Let me explain the problem. I have created a few months ago a simple tool in vb.net, that sends an xml code to server, and that server sends response after a while. Everything is performed in http session, for that purpose I use webbrowser control and webclient. I know it could have been solved in different way, however iam not an expert in vb.net, and also didnt want to spend too much time on it. Anyway it worked, until they had changed something on the server. Let me explain in a few words how that tool works, so it will be easier to understand the problem.
In the first part, I open an URL in the webbrowser control, subsequently I enter xml code in the textarea on that page and click on the submit button. In result of that I get another page with some data on it, namely links to xls files. In the next part I use webclient for downloading those files. What is important for all of these operations I need to use the same http session id.
So, simply by now, i just set headers in webclient - WebClient.Headers.Add("Cookie", WebBrowser1.Document.Cookie.ToString) What have guaranteed to use the same session id by the WebClient. However, after the change made on the server mentioned before, the JSESSIONID value is not available in that string. When I use https analyzer (fiddler), I can see that value there...until moment when I am using WebClient. Of course due to that fact, the webclient won't download files for me, because the session id is not the same.
There is one more thing, what would be useful. When I checked the cookies file on my harddrive, I saw that line starts like #HTTP_ONLY. I think that would cause that problem with jsessionid.
Now, I am coming to my question Do you have any idea, how I would get that JSESSIONID value ? It is sent from webbrowser control, however don't know how to get it.
Thanks in advance !!
Last edited by patrickoq; Jun 12th, 2011 at 01:19 PM.
-
Jun 12th, 2011, 11:48 PM
#2
Re: HTTP Headers
It is sent from webbrowser control, however don't know how to get it.
How is it sent to the WebBrowser control? Are you saying that is some type of http response? Or are you saying that the page source contains this id? I think we might need a few more details.
-
Jun 13th, 2011, 12:03 AM
#3
Thread Starter
Junior Member
Re: HTTP Headers
Sure, will provide all the details in next 5 hours. Need to get to my pc. Hate typing on my cell.
-
Jun 13th, 2011, 04:09 PM
#4
Thread Starter
Junior Member
Re: HTTP Headers
Hey ForumAccount,
Please find answers below to your questions:
How is it sent to the WebBrowser control?
Per my description in the previous post. The xml code is enter into textarea (programically), and subsequently the submit button is clicked (doing that programically by submitting form by javascript code). What causing that the xml is sent in the POST array to the server. So simply I am imitating the web browser behaviour, but it is not visible for user. As a response I get new page that contains links to the csv files. I am reading all the links from the page source, and entering them in the WebClient what downloads all those files for me. What is important, I need to be still in the same session id. It had been working for 1 year for me. Until that change mentioned before on the server side, i saw in the cookies file that line starts like #HTTP_ONLY. Maybe that's why that is WebBrowser1.Document.Cookie.ToString doesn't have the session id value anymore. What is the most important for me is to get that value. I checked headers sent by that webbrowser control in the http analyzer, and I see that session id is included in the headers.. Please let me know if this info is enough for you or you need more specific... Thanks
-
Jun 13th, 2011, 04:19 PM
#5
Re: HTTP Headers
Are you trying to get the response headers after you navigate a WebBrowser?
-
Jun 13th, 2011, 06:17 PM
#6
Thread Starter
Junior Member
Re: HTTP Headers
I was trying from Navigating,Navigated, and Completed. And none of them has that value....I tried to get headers from in all of these events, unfortuantely the same reason. There must be a way to get that value
Last edited by patrickoq; Jun 14th, 2011 at 12:21 AM.
-
Jun 19th, 2011, 03:34 AM
#7
Thread Starter
Junior Member
Re: HTTP Headers
Hi, any idea how to get that data from headers ? There must be other way for getting it.
THank you
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|