hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thandra, Kiran" <Extern.Kiran.Than...@vw.com>
Subject Method does not exist exception
Date Wed, 11 Dec 2002 20:56:50 GMT

Getting no such method exists:
org.apache.commons.httpclient.methods.GetMethod get = new
org.apache.commons.httpclient.methods.GetMethod("/OrgUsrEdit.asp");

get.execute(state,conn);







-----Original Message-----
From: Thandra, Kiran [mailto:Extern.Kiran.Thandra@vw.com]
Sent: Wednesday, December 11, 2002 3:17 PM
To: 'Commons HttpClient Project'
Subject: Problems in exucuting multiple methods withins same connection 


Hi,
Having Problems in exucuting multiple methods withins same connection .
Any suggestions appreciaetd.
 
java.net.URL u = new java.net.URL(" http://xyz-abc.com <http://xyz-abc.com>
");
org.apache.commons.httpclient.HttpClient client=new
org.apache.commons.httpclient.HttpClient();
    
                client.startSession(u);
                org.apache.commons.httpclient.methods.PostMethod post = new
org.apache.commons.httpclient.methods.PostMethod("/verifyuser.asp");
 org.apache.commons.httpclient.NameValuePair form_data[] = new
org.apache.commons.httpclient.NameValuePair[2];
         post.setRequestHeader("Content-type", "text/html");

            form_data[0] = new
org.apache.commons.httpclient.NameValuePair("uid", "hbvfv");
                form_data[1] = new
org.apache.commons.httpclient.NameValuePair("pwd","bchbhbfhbh");
                  
      // 6. set the query parameters you want to post to the page
            post.addParameters(form_data);
    
                int iResultCode = client.executeMethod(post);
               
                System.out.println("iResultCode = " + iResultCode);

                byte[] yaResponse = post.getResponseBody();


//org.apache.commons.httpclient.methods.HeadMethod head = new
org.apache.commons.httpclient.methods.HeadMethod();

 org.apache.commons.httpclient.Header head[] =post.getResponseHeaders();

 org.apache.commons.httpclient.Cookie[] respCookie =
client.getState().getCookies();

  
//Succcesfully executed till here with status code 


Request 2 within the same session

Basically iam trying to call a url from the site i connected to
 client.getState().addCookies(respCookie);

 org.apache.commons.httpclient.methods.GetMethod get = new
org.apache.commons.httpclient.methods.GetMethod("/admin/xyzUsrEdit.asp?OrgID
=abchvdc&Action=New");

 org.apache.commons.httpclient.NameValuePair form_data1[] = new
org.apache.commons.httpclient.NameValuePair[2];
       
                //get.setRequestHeader("Content-type", "text/html");
     // get.setRequestHeader("Location", "/admin/xyzUsrEdit.asp");

       // get.setRequestHeader(Location," /a dmin/orgxyz.asp
<http://qs-portal.cpn.vwg/admin/OrgUsrEdit.asp> ");
            form_data1[0] = new
org.apache.commons.httpclient.NameValuePair("ars", "assss970");
             form_data1[1] = new
org.apache.commons.httpclient.NameValuePair("acgacgc","New");
        //get.setQueryString(form_data1);
         client.executeMethod(get);
byte[] getResponse = get.getResponseBody();
                client.endSession();

-----Original Message-----
From: Kalnichevski, Oleg [ mailto:oleg.kalnichevski@bearingpoint.com
<mailto:oleg.kalnichevski@bearingpoint.com> ]
Sent: Wednesday, December 11, 2002 7:55 AM
To: Commons HttpClient Project
Subject: [PATCH] PostMethod does properly recycle when request buffering
is used


Please use TestPostRecycle test case to reproduce the problem. The patch
attached below should fix the problem

Oleg



Mime
View raw message