On Sat, 2008-05-10 at 11:42 -0700, bin chen wrote: > Oleg: > Thanks for your reply. I forgot the put in my email that I did find out > using MultipartRequestEntity to post my request, but the problem remained. I > believe that the reason is that the __EVENTVALIDATION changes after the > submit button was hit. I still don't know how to get around of this. Any > suggestion? > > > Your help is highly appreciated, >
Bin, Please make sure you have read this: http://wiki.apache.org/HttpComponents/ForAbsoluteBeginners Oleg > DRB > > On Sat, May 10, 2008 at 4:07 AM, bin chen <[EMAIL PROTECTED]> wrote: > > > After looking at the log more carefully, I found that the form I was trying > > to post was a multipart/form. I tried using MultipartPostMethod which was > > deprecated and still got the same problem. Is there anyway to deal with > > multipart/form posting using HttpClient? > > > > DRB > > > > Attaching the debugging message from my code > > > > 2008/05/10 03:55:11:406 PDT [DEBUG] header - >> "POST /queryPage/Query.aspx > > HTTP/1.1[\r][\n]" > > 2008/05/10 03:55:11:406 PDT [DEBUG] HttpMethodBase - Adding Host request > > header > > 2008/05/10 03:55:11:406 PDT [DEBUG] HttpMethodBase - Default charset used: > > ISO-8859-1 > > 2008/05/10 03:55:11:421 PDT [DEBUG] HttpMethodBase - Default charset used: > > ISO-8859-1 > > 2008/05/10 03:55:11:421 PDT [DEBUG] header - >> "User-Agent: > > Mozilla/4.0[\r][\n]" > > 2008/05/10 03:55:11:421 PDT [DEBUG] header - >> "Host: www.gttglobal.com > > [\r][\n]" > > 2008/05/10 03:55:11:421 PDT [DEBUG] header - >> "Cookie: $Version=0; > > ASP.NET_SessionId=5fpcgaev4l5ddr55zwsid5mh; $Path=/[\r][\n]" > > 2008/05/10 03:55:11:421 PDT [DEBUG] header - >> "Content-Length: > > 15614[\r][\n]" > > 2008/05/10 03:55:11:421 PDT [DEBUG] header - >> "Content-Type: > > application/x-www-form-urlencoded[\r][\n]" > > 2008/05/10 03:55:11:421 PDT [DEBUG] header - >> "[\r][\n]" > > 2008/05/10 03:55:11:421 PDT [DEBUG] EntityEnclosingMethod - Request body > > sent > > 2008/05/10 03:55:11:796 PDT [DEBUG] header - << "HTTP/1.1 500 Internal > > Server Error[\r][\n]" > > 2008/05/10 03:55:11:796 PDT [DEBUG] header - << "HTTP/1.1 500 Internal > > Server Error[\r][\n]" > > 2008/05/10 03:55:11:796 PDT [DEBUG] header - << "Date: Sat, 10 May 2008 > > 10:53:30 GMT[\r][\n]" > > 2008/05/10 03:55:11:796 PDT [DEBUG] header - << "Server: > > Microsoft-IIS/6.0[\r][\n]" > > 2008/05/10 03:55:11:796 PDT [DEBUG] header - << "X-Powered-By: ASP.NET > > [\r][\n]" > > 2008/05/10 03:55:11:796 PDT [DEBUG] header - << "X-AspNet-Version: > > 2.0.50727[\r][\n]" > > 2008/05/10 03:55:11:796 PDT [DEBUG] header - << "Cache-Control: > > private[\r][\n]" > > 2008/05/10 03:55:11:796 PDT [DEBUG] header - << "Content-Type: text/html; > > charset=utf-8[\r][\n]" > > 2008/05/10 03:55:11:796 PDT [DEBUG] header - << "Content-Length: > > 7593[\r][\n]" > > 2008/05/10 03:55:11:796 PDT [DEBUG] header - << "[\r][\n]" > > > > The result responsebody has the following: > > *Invalid postback or callback argument. Event validation is enabled using > > <pages enableEventValidation="true"/> in configuration or <%@ Page > > EnableEventValidation="true" %> in a page. For security purposes, this > > feature verifies that arguments to postback or callback events originate > > from the server control that originally rendered them. If the data is valid > > and expected, use the ClientScriptManager.RegisterForEventValidation method > > in order to register the postback or callback data for validation.* > > > > > > > > On Thu, May 8, 2008 at 2:40 AM, bin chen <[EMAIL PROTECTED]> wrote: > > > >> Hi, I am trying to post a request to a website with my account to get > >> information without physically logging onto the site. After posting request > >> to the login page and getting in, I got to the redirected page which > >> contains the form I needed for getting the info. In the form, there were > >> two > >> hidden inputs, one was for state, and the other was for validation, I could > >> get both of those two values using GET method to the URL, with those values > >> available, I tried to post my request. However, after posting my request, I > >> got an Http 500, internal error exception. The response of my request > >> indicated that the validation data was not correct. After getting on the > >> physical website and looking through the posting request process carefully, > >> I found that there was an intermediate stage where the page's URL stayed > >> the > >> same, but the page was showing "wait..." as the request was being > >> processed, > >> at this point, the validate value was changed while the state value > >> remained > >> unchanged. I also tried to go through the process by using loadrunner, > >> loadrunner could get through the process successfully, and the recorded > >> process showed that the intermediate stage indeed existed, with the same > >> action and referer, the submit button value was set to "processing" in that > >> stage and the validate value was different before the request was submitted > >> (with all the necessary inputs filled in) and the intermediate stage. How > >> can I get around of this intermediate stage and get to the final result > >> page > >> I wanted? I am sure this can be done since LoadRunner can do it without > >> problem. My questions are > >> 1. How to get the validate value from the intermediate stage (which I > >> don't even know how to access using http client) > >> 2. How to post it so that I can get the final result. > >> > >> Regards, > >> > >> DRB > >> > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
