By the way, just now I tested the HttpClient PostSOAP.java. This
program does not work on my machine. The error message is as follows.

Is this the XML parsing problem? I am using Axis2 0.95 libraries which
use StAX parser. Is it possible that my previous failure also due to
the library incompatibility?



1500795 [http-8080-Processor24] ERROR
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/axis2].[AxisServlet]
- Servlet.service() for servlet AxisServlet threw exception
java.lang.NullPointerException
        at 
com.ctc.wstx.io.ReaderBootstrapper.verifyXmlEncoding(ReaderBootstrapper.java:213)
        at 
com.ctc.wstx.io.ReaderBootstrapper.bootstrapInput(ReaderBootstrapper.java:143)
        at 
com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:503)
        at 
com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:558)
        at 
com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:578)
        at 
com.ctc.wstx.stax.WstxInputFactory.createXMLStreamReader(WstxInputFactory.java:284)
        at 
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:210)
        at 
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:160)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


Regards,

Xinjun


On 8/11/06, Xinjun Chen <[EMAIL PROTECTED]> wrote:
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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to