On Sat, 2008-05-10 at 04:07 -0700, bin chen 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?
> 

Use MultipartRequestEntity

Oleg


> 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]

Reply via email to