I send SOAP messages from an Oracle 9 database to an Axis server.
In the first case I set the content's length, everything works fine, I get the desired answer. Here is the request message I got it with the TCPMonitor application:
----------------------------------------------------------------------------
POST /axis/services/JChemServices HTTP/1.0 Content-Type: text/xml Content-Length: 3317 SOAPAction: search Connection: close
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body><search
xmlns:ns2="http://localhost:8091/axis/services/MyServices"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><param xsi:type="xsd:string">data</param></search></SOAP-ENV:Body></SOAP-ENV:Envelope>
--------------------------------------------------------------------------------
In the second case I don't know the content's length thus I cannot set the content length header. Instead of I set the Transfer-Encoding: chunked header. This is the message:
-------------------------------------------------------------------------------
POST /axis/services/JChemServices HTTP/1.0 Transfer-Encoding: chunked Content-Type: text/xml SOAPAction: search Connection: close
cf5
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body><search
xmlns:ns2="http://localhost:8091/axis/services/MyServices"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><param xsi:type="xsd:string">data</param></search></SOAP-ENV:Body></SOAP-ENV:Envelope>
0
-------------------------------------------------------------------------------
In the second case I get this exception from the Axis server:
HTTP/1.1 500 Internal Server Error Content-Type: text/xml; charset=utf-8 Date: Fri, 21 Nov 2003 14:32:23 GMT Server: Apache Coyote/1.0 Connection: close
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode>
<faultstring>org.xml.sax.SAXParseException: Content is not allowed in prolog.</faultstring>
<detail/>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
What's wrong?
ciao, Gabor
