You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "McCullough, Ryan" <rm...@rightnow.com> on 2008/12/17 23:03:07 UTC

Axis 1.4 getResponseHeaders() sometimes returning empty array

I am using Axis (not Axis2) 1.4.

After submitting a request to the server and receiving a response, I am calling SoapBindingStub.getResponseHeaders() (extends org.apache.axis.client.Stub).

Sometimes (rarely), getResponseHeaders() returns an empty SOAPHeaderElement[] array. The length of the array is 0.

The response from the server has what looks like a valid header:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header><ResponseHeader xmlns="urn:obj.api.rightnow.com"><Version>8.4.0.95</Version></ResponseHeader></soap:Header><soap:Body><exec_rv xmlns="urn:obj.api.rightnow.com">
<transaction_rv>
<!-- SNIP -->
</transaction_rv>
    </exec_rv></soap:Body></soap:Envelope>

Here is the function from org/apache/axis/client/Stub.java:
    /**
     * Get the array of response header elements
     */
    public SOAPHeaderElement[] getResponseHeaders() {
        SOAPHeaderElement[] array = new SOAPHeaderElement[0];
        try
        {
            if (_call == null)
                return array;
            Vector h = _call.getResponseMessage().getSOAPEnvelope().getHeaders();
            array = new SOAPHeaderElement[h.size()];
            h.copyInto(array);
            return array;
        }
        catch (Exception e)
        {
            return array;
        }
    }

It looks like an exception is being thrown in the try block somewhere before the array is resized.

Any ideas what may be causing this?

I have enabled log4j logging and set the root category to be DEBUG and am waiting for the issue to be reproduced.

-Ryan

Ryan McCullough | RightNow Technologies | Integration Tools Engineer
406-556-3162 office | Bozeman, MT | rmccullough@rightnow.com<ma...@rightnow.com> | http://www.rightnow.com<http://www.rightnow.com/>


RE: Axis 1.4 getResponseHeaders() sometimes returning empty array

Posted by "McCullough, Ryan" <rm...@rightnow.com>.
Bump.

From: McCullough, Ryan [mailto:rmccullough@rightnow.com]
Sent: Wednesday, December 17, 2008 3:03 PM
To: axis-user@ws.apache.org
Subject: Axis 1.4 getResponseHeaders() sometimes returning empty array

I am using Axis (not Axis2) 1.4.

After submitting a request to the server and receiving a response, I am calling SoapBindingStub.getResponseHeaders() (extends org.apache.axis.client.Stub).

Sometimes (rarely), getResponseHeaders() returns an empty SOAPHeaderElement[] array. The length of the array is 0.

The response from the server has what looks like a valid header:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header><ResponseHeader xmlns="urn:obj.api.rightnow.com"><Version>8.4.0.95</Version></ResponseHeader></soap:Header><soap:Body><exec_rv xmlns="urn:obj.api.rightnow.com">
<transaction_rv>
<!-- SNIP -->
</transaction_rv>
    </exec_rv></soap:Body></soap:Envelope>

Here is the function from org/apache/axis/client/Stub.java:
    /**
     * Get the array of response header elements
     */
    public SOAPHeaderElement[] getResponseHeaders() {
        SOAPHeaderElement[] array = new SOAPHeaderElement[0];
        try
        {
            if (_call == null)
                return array;
            Vector h = _call.getResponseMessage().getSOAPEnvelope().getHeaders();
            array = new SOAPHeaderElement[h.size()];
            h.copyInto(array);
            return array;
        }
        catch (Exception e)
        {
            return array;
        }
    }

It looks like an exception is being thrown in the try block somewhere before the array is resized.

Any ideas what may be causing this?

I have enabled log4j logging and set the root category to be DEBUG and am waiting for the issue to be reproduced.

-Ryan

Ryan McCullough | RightNow Technologies | Integration Tools Engineer
406-556-3162 office | Bozeman, MT | rmccullough@rightnow.com<ma...@rightnow.com> | http://www.rightnow.com<http://www.rightnow.com/>