2

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.

lucasdclopes
  • 147
  • 9
  • 1
    Range check error sounds like a Delphi exception. Can you run and test the SOAP server outside IIS as a stand-alone application? – mjn Nov 17 '15 at 09:09
  • It worked 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. I still don't know how to fix this. I'll update OP with this new information. Thanks. – lucasdclopes Nov 17 '15 at 13:32
  • If it works stand-alone but not with ISAPI, I would search for an existing known issue in the Embarcadero issue tracking system – mjn Nov 17 '15 at 13:45
  • I've already tried embarcadero's QC before posting here. Unfortunately, to no avail. Now I tried running this web service under IIS 8.5 (Windows Server 2012 R2), same result, doesn't work with chunked requests. – lucasdclopes Nov 17 '15 at 17:30

0 Answers0