You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-user@axis.apache.org by Fred Preston <PR...@uk.ibm.com> on 2005/10/14 11:27:58 UTC

Re: Exception received from with AXIS-C & SS

Hi Jason,
        The config file looks fine although I would not mix debug and 
non-debug libraries (I prefer to use the non-debug versions with a 
non-debug client application (don't forget to use the /MD option on your 
compiler when building the application)).  If you are not getting a reply 
(I assume this from the exception information about not getting a HTTP 
header), I would first look at the URL and whether SSL has been enabled on 
your server.  But because you have already checked these, and you know 
they work with 'normal' http and https with a java client I am at a bit of 
a loss.  Looking at the exception that is thrown,  I can explain a little 
about the transport side...  Axis is waiting for the corresponding 
response message and getBytes is responsible for pulling the message from 
the socket.

AXIS_TRANSPORT_STATUS HTTPTransport::getBytes( char * pcBuffer, int * 
piSize) throw (AxisException, HTTPTransportException)

Within getBytes, the code enters a loop that will wait for data to arrive 
on the socket.

        do
        {
// Read whatever part of the response message that has arrived at the 
active
// channel socket.
                m_pszRxBuffer[0] = '\0';
                *m_pActiveChannel >> m_pszRxBuffer;

// Add the new message part to the received string.
                m_strReceived += m_pszRxBuffer;

// Do iteration processing.
                if( strlen( m_pszRxBuffer) > 0)
                {
                        iIterationCount = 100;
                }
                else
                {
                        iIterationCount--;
                }

// Check for beginning and end of HTTP header.
                if( m_strReceived.find( ASCII_S_HTTP) != std::string::npos 
&&
                        m_strReceived.find( ASCII_S_CRLFCRLF) != 
std::string::npos)
                {
                        bHTTPHeaderFound = true;
                }
        } while( !bHTTPHeaderFound && iIterationCount > 0);

If no data arrives within about 10 seconds or so then the iteration count 
will have dropped to zero and an exception will be thrown. (NB: The code 
has changed recently and the messages have also changed, but this is where 
Axis is failing.)

// If the HTTP header was not found in the given number of iterations then
// throw an exception.
        if( iIterationCount == 0)
        {
                throw HTTPTransportException( 
SERVER_TRANSPORT_INPUT_STREAMING_ERROR,
 "Timed out waiting for HTTP header message.");
        }

So this brings me back to my original though that the request message is 
being sent, but no response message is being received.  This could be 
because the server is not responding (we know this is not correct because 
your java application works well) or because openSSL has thrown it away as 
an invalid message for what ever reason.  Unfortunately, if this is the 
case, openSSL does not tell the Axis so we have no way of knowing or 
trapping this situation.  Here is the SSLChannel code...

int HTTPSSLChannel::ReadFromSocket( const char * pszRxBuffer)

nByteRecv = SSL_read( m_sslHandle, (void *) pszRxBuffer, BUF_SIZE - 1);

Looking at the description (http://www.openssl.org/docs/ssl/SSL_read.html) 
we could add a little more information to the basic exception message and 
I will raise a JIRA to do so, but it looks to me as if SSL is just not 
recognising your response message or the response message is not getting 
through.  I'm wondering if this could be because maybe you have different, 
versions of openSSL at client and server that are somehow incompatible?

Regards,

Fred Preston.





Jason Musgrave <js...@gmail.com>
13/10/2005 20:20
Please respond to "Apache AXIS C User List"
 
        To:     axis-c-user@ws.apache.org
        cc: 
        Subject:        Exception recieved from with AXIS-C & SS

 

Hello,
     I am running Axis-C 1.5 using Openssl 0.9.8... (All on windows 2k
Terminal server).  The calculator example.
     I'm trying run against an 1.2.1 java axis instance running in
apache tomcat on AIX.  (a tweaked calculator example.)  It works fine
on HTTP... it adds 10 & 5 and gets 15.  (It also works fine with a
java axis client on both http & https.)  It fails with AXIS-C with the
following message

Exception : HTTPTransportException:Input streaming error while getting 
data Time
d out waiting for HTTP header message (1).

### A Snippet of my axis conf file.
XMLParser:AxisXMLParserXerces.dll
Transport_http:HTTPTransport_D.dll
#Transport_http:HTTPTransport.dll
Channel_HTTP:HTTPChannel.dll
Channel_HTTP_SSL:HTTPSSLChannel_D.dll

using --> Transport_http:HTTPTransport.dll I only see:
Unknown exception has occured

So, my question is: where am I screwing up?  Is my OPENSSL setup
wrong, or have I built / configed the ssl channel stuff wrong?  Please
let me know if there is any more Information I can provide.