We have a Delphi SOAP Web Service running under IIS 7.5 (Windows Server 2008 R2), and we are experiencing a problem when a client sends chunked requests. After the client sends the requests, the server responds almost immediately with a HTTP 500 error with the following message:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>Range check error</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
I made a sample Web Service to try to isolate the problem, and even with only one method I get the same result.
Sample Web Service code:
interface
uses Soap.InvokeRegistry, System.Types, Soap.XSBuiltIns, SimpleWsTestIntf;
type
{ TSimpleWsTest }
TSimpleWsTest = class(TInvokableClass, ISimpleWsTest)
public
function echoString(const Value: String): String; stdcall;
end;
implementation
function TSimpleWsTest.echoString(const Value: String): String; stdcall;
begin
Result := Value;
end;
This is the request header of a request that generate the problem:
POST http://testserver/web/SimpleWsTest.dll/soap/ISimpleWsTest HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "urn:SimpleWsTestIntf-ISimpleWsTest#echoString"
Transfer-Encoding: chunked
Host: testserver
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
And this one works with no problems:
POST http://testserver/web/SimpleWsTest.dll/soap/ISimpleWsTest HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "urn:SimpleWsTestIntf-ISimpleWsTest#echoString"
Content-Length: 468
Host: testserver
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
Is this client request valid? Is it an application fault or a badly configured IIS?
Any help will be appreciated.
Updating with new information:
It works running outside IIS (stand-alone application) with chunked requests. I also tried a WCF C# Web Service under the same IIS and it works too with chunked requests. So the problem seems to be a combination of Delphi + IIS, or a problem with IIS's ISAPI.