hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xinjun Chen" <xjchen...@gmail.com>
Subject Re: Problem with a router servlet - end client cannot get response
Date Fri, 11 Aug 2006 06:46:57 GMT
Hi Roland,

Thank you very much for your suggestion.
I really have not yet read through the RFC2616. I knows about HTTP
from books talking about J2EE. I have started reading RFC2616.

I have inspected the log messages, and find that no footers are
involved. And another finding is that the target service is actually
executed! But the router servlet cannot successfully send the response
to the end client.

The other query is why the router servlet works fine for some web services.


I hope I can find the answer soon.


Regards,
Xinjun

On 8/11/06, Roland Weber <http-async@dubioso.net> wrote:
> Hello Xinjun,
>
> I suggest you take a long, good, in-depth look at RFC 2616:
> http://www.ietf.org/rfc/rfc2616.txt
> There are PDF versions on the web if you prefer that.
> In particular, you should study *everything* the RFC says
> about proxies, because that's what your "router" is. And
> there is a whole lot about proxies, including information
> on which header fields must be passed through by a proxy
> and which ones are strictly link-to-link and MUST NOT be
> passed on to the next server. Once you've done that, fix
> the following part of your code:
>
> > Enumeration headerNames = request.getHeaderNames();
> > while (headerNames.hasMoreElements()) {
> >    String name = (String) headerNames.nextElement();
> >    Enumeration values = request.getHeaders(name);
> >    while(values.hasMoreElements()) {
> >        String value = (String) values.nextElement();
> >        log.debug(name + ":" + value + "\n");
> >        method.addRequestHeader(name, value);
> >    }
> >}
>
> and also this:
>
> > Header[] headers = method.getResponseHeaders();
> >    int headerSize = headers.length;
> >    for (int i = 0; i < headerSize; i++) {
> >        log.debug(headers[i].getName() + ":-" + headers[i].getValue());
> >        response.addHeader(headers[i].getName(), headers[i].getValue());
> >    }
>
> The following part is questionable, since one of the headers
> usually specifies which footers are to expect, and turning
> footers into header could make the request invalid:
>
> >    Header[] footers = method.getResponseFooters();
> >    int footerSize = footers.length;
> >    for (int i = 0; i < footerSize; i++) {
> >        log.debug(footers[i].getName() + ":-" + footers[i].getValue());
> >        response.setHeader(footers[i].getName(), footers[i].getValue());
> >    }
>
> On the other hand, it shouldn't matter. You're trying to access
> the footers before receiving the message body, so they aren't
> yet available anyway.
>
> cheers,
>  Roland
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
>
>

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


Mime
View raw message