axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henrik Nordberg" <>
Subject Re: array example axis 1.6 alpha
Date Mon, 27 Jun 2005 19:18:23 GMT
Hi again,

I checked the code and there are two types of constants that are used to create exceptions:
enums and constant strings

In the case below (CLIENT_SOAP_SOAP_CONTENT_ERROR) we have an enum value. So it shouldn't
trigger bug 707. This bug only applies when "FOO" type constants are passed in. (Though, there
is still a bug in that delete is used instead of delete[], and it would still be much better
if const string& was used.)

 - Henrik
  ----- Original Message ----- 
  From: Henrik Nordberg 
  To: Apache AXIS C User List 
  Sent: Monday, June 27, 2005 11:31 AM
  Subject: Re: array example axis 1.6 alpha


  There are a few things wrong here. First the two problems I am sure of:

  A constant character array is passed to the ctor of AxisSoapException. This array is passed
to the processException() method, which destroys it using operator delete. 

  Dev team, please switch to using std::string instead of char*. You can still pass in constant
char* if you have your arguments be const std::string&.
  Currently there are many places in the code where "some constant" is passed to the ctors
of various exceptions. Then those exceptions delete the strings and the server crashes (if
we are lucky), as happened in this case.

  I have reported this bug (which really is several bugs) to JIRA:
  But only a very small part of the problem was addressed and then the bug was closed. This
bug needs to be re-opened and fixed completely by removing the delete/delete[] in processException()
and having the ctor take a const std::string& instead of char*. We also need to remove
the places where new[] was used to create the argument to the ctor, but this is a small price
to pay to avoid a crashing server.

  The other aspect is the cause of your exception. I am not as sure about this one, but would
guess that the client and server are using different SOAP encodings (Doc literal vs. RPC).

   - Henrik
    ----- Original Message ----- 
    From: krishna 
    To: ; Krishna Kumar Rajagopalan 
    Sent: Monday, June 27, 2005 11:08 AM
    Subject: array example axis 1.6 alpha

    Hi All

    I installed axis1.6 alpha ( code from the cvs ) and was able to install the samples too.
I am having trouble with the array sample (The calculator works fine) The output which I get
by running the array example is 

    /usr/local/axis1.6a/axis-c-1.6a.n-Linux-src/obj/samples$ array
    Soap content is not valid
    free(): invalid pointer 0xbfffee70!
    ---------------------- TEST COMPLETE -----------------------------

    How can i correct this problem? I have given some more observations below

    1.    Given below is part of the SOAP RESPONSE

    <faultstring>Soap content is not valid</faultstring>
    <faultactor>server name:listen port</faultactor>
    <detail><appSpecific><detail>AxisSoapException:Received content is faulty</detail>

    Please find the complete SOAP-REQUEST and RESPONSE at the end of the message

    On debugging the server it was found that the Exception is thrown at
    because is m_pSZ is RPC_ENCODED and nBindingStyle is DOC_LITERAL

    if (m_pSZ->getStyle () != nBindingStyle)
        222             {
        224                 throw AxisSoapException(CLIENT_SOAP_SOAP_CONTENT_ERROR);
        225                 //m_pSZ->
        226                 //    setSoapFault(SoapFault::getSoapFault(CLIENT_SOAP_SOAPCONTENTERROR));
        227                 break; // do .. while(0)
        228             }

    2.   On debugging the client it was found that the 
           m_PSZ->nBindingStyle was initially set to DOC_LITERAL but changes to UNKNOWN_PROVIDER
           Please found some gdb output below

    axiscpp::SoapSerializer::setSoapVersion (this=0x8051d88, nSoapVersion=SOAP_VER_1_1) at
    195           _Rb_tree_iterator(_Link_type __x) { _M_node = __x; }
    (gdb) watch m_ProviderType
    Watchpoint 5: this->m_ProviderType
    (gdb) n
    508         lower_bound(const key_type& __x) { return _M_t.lower_bound(__x); }
    (gdb) n
    235         { return __x._M_node == __y._M_node; }
    (gdb) s
    Watchpoint 5: this->m_ProviderType

    Old value = CPP_DOC_PROVIDER
    New value = UNKNOWN_PROVIDER
    axiscpp::SoapSerializer::setSoapVersion (this=0x804d770, nSoapVersion=SOAP_VER_1_1) at

    Thanks in Advance


    POST /axis/array HTTP/1.1 
    Host: localhost:80 
    Content-Type: text/xml; charset=UTF-8 
    SOAPAction: "array#getInput" 
    Content-Length: 2761 
    <?xml version='1.0' encoding='utf-8' ?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:xsd=""
    <ns1:getInput xmlns:ns1="">
    . <ns1:item>98</ns1:item>

    HTTP/1.1 200 OK 
    Date: Mon, 27 Jun 2005 15:27:13 GMT 
    Server: Apache/1.3.33 (Debian GNU/Linux) 
    Transfer-Encoding: chunked 
    Content-Type: text/xml 
    <?xml version='1.0' encoding='utf-8' ?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:xsd=""
    <faultstring>Soap content is not valid</faultstring>
    <faultactor>server name:listen port</faultactor>
    <detail><appSpecific><detail>AxisSoapException:Received content is faulty</detail>


View raw message