Hi,
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.
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 -----
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
<faultcode>SOAP-ENV:Client</faultcode>
<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
/usr/local/axis1.6a/axis-c-1.6a.n-Linux-src/src/engine/server/ServerAxisEngine.cpp:224
because
is m_pSZ is RPC_ENCODED and nBindingStyle is DOC_LITERAL
if
(m_pSZ->getStyle () != nBindingStyle)
222
{
223
AXISTRACE1 ("CLIENT_SOAP_SOAP_CONTENT_ERROR", CRITICAL);
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
stl_tree.h:195
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 stl_tree.h:195
Thanks
in Advance
Krishna
COMPLETE SOAP
MESSAGE REQUEST AND RESPONSE
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="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:getInput
xmlns:ns1="http://simpletypearray.test.apache.org">
<input><ns1:item>0</ns1:item>
<ns1:item>1</ns1:item>
<ns1:item>2</ns1:item>
...............
.
<ns1:item>98</ns1:item>
<ns1:item>99</ns1:item>
</input>
</ns1:getInput>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
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
22c
<?xml version='1.0' encoding='utf-8'
?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring>Soap
content is not valid</faultstring>
<faultactor>server
name:listen
port</faultactor>
<detail><appSpecific><detail>AxisSoapException:Received
content is
faulty</detail>
</appSpecific></detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>