hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stone, Robert" <t_rst...@qualcomm.com>
Subject RE: HttpClient and SiteMinder
Date Fri, 18 Mar 2005 19:00:00 GMT
Oh, yeah, another thing. When it goes to limbo it completely ignores the
timeout settings, I'm actually fine with it timing out and throwing
exception that I can catch and do something. Never happens.

Robert S.

-----Original Message-----
From: Stone, Robert [mailto:t_rstone@qualcomm.com] 
Sent: Thursday, March 17, 2005 2:56 PM
To: httpclient-user@jakarta.apache.org
Subject: HttpClient and SiteMinder

Hi all,


I'm trying to execute POST method on SiteMinder login.fcc page.


The way it works - when user hits the SM protected page, SM agent
intercepts the request and forward is to the login page. That page
contains few form fields and has its action set to

I'm trying to do this last POST programmatically using HttpClient

Problem is that once I do httpClient.executeMethod(postMethod) I never
get response back and program hangs until the session timeout. That, I
understand is due to the fact that instead of replying to POST request,
SM agent does it thing and redirects to the original targeted page.

So what I need is to execute POST method end exit without waiting for
the response to come. Is it possible and if yes can someone tell me how
to do it?


Here's method that will never pass executeMethod line


     * @param command

     * @param errors


    public void processLogin(HttpServletRequest request,

            HttpServletResponse response, Object command, BindException
errors) {

        HttpClientParams params = client.getParams();


                new Boolean(true));


                new Long(3000));


                new Boolean(false));


        UserData userData = (UserData) command;

        PostMethod post = new PostMethod(smPath);

        post.addParameter("SMAUTHREASON", "0");

        // getting right back at ya


                .addParameter("TARGET", "$SM$"

                        + request.getRequestURL().toString());

        post.addParameter("USER", userData.getUserName());

        post.addParameter("PASSWORD", userData.getUserPassword());

        try {

            if (logger.isInfoEnabled())

                logger.info("Making POST request to " + smPath);



            if (logger.isInfoEnabled())

                logger.info("Back from executing post");

            if (post.getStatusCode() == HttpStatus.SC_OK) {

                List headers = Arrays.asList(post.getResponseHeaders());

                for (Iterator i = headers.iterator(); i.hasNext();) {

                    processResponseHeaders(errors, i);


                if (logger.isInfoEnabled())

                    if (!errors.hasErrors())

                        logger.info("Successful login for user "

                                + userData.getUserName());

            } else {

                errors.rejectValue("userName", "errors.logging.failed",

                        new String[] { post.getStatusText() }, post



        } catch (Exception e) {


            errors.rejectValue("userName", "errors.logging.final",

                    new String[] { e.getMessage() }, e.getMessage());



To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org

View raw message