The problem is that **sporadically** the data that the client receives (Indy
based) is corrupted.
This happens randomly approximately once every 20/30 calls or sometimes
before. The rest of the times everything works just fine.
The problem arises when I am sending compressed binary data (I compress the
SOAP envelope using the zlib unit).
I had the ISAPI save the response on a file immediately after sending it and
the client as soon as it receives it. By comparing the two files I noticed
how they are different. Immediately after that I also decompressed the
response and saved that server side to make sure that the data that was
supposed to send was ok. It is. Compression doesn't seem to the the problem.
Apparently there's always a group of 4 bytes which is different.
For instance:
#145 #186 @ offset 45190
#17 #43 @ offset 45191
#28 #83 @ offset 45192
#141 #183 @ offset 45193
I am clueless...
An help would be eternally appreciated ;-)
--
Alessandro Federici
System Architect
Borland Certified Consultant
-----
http://www.msdelphi.com (home of the DSOAP Toolkit 2.0)
al...@msdelphi.com (primary)
al...@bigfoot.com (routes to the first)
king...@hotmail.com (if you have troubles with the others)
Forgot to mention another thing.
The problem arises when then data passes the 38kb or so (I don't have a
precise number).
The two tests that were giving me problems were 130kb and 71kb respecively.
With smaller buffers there seem to be no problem...
Is it Webbroker or Indy?
This sounds like the webbroker file upload problem, have a search through
google as this was mentioned here a few months back and some code fixes were
posted here, I have this saved but haven't tested it myself (posted by Dave
Nottage) :
> Can someone guide me to the hack/solution that solves this problem?
In WebBrokerSOAP.PAS:
BytesRead := Length(Request.Content);
// Fixed code:
if BytesRead < Request.ContentLength then
begin
SetLength(Buffer, Request.ContentLength);
Stream.Write(Request.Content[1], BytesRead);
repeat
// --> added "[BytesRead]"
ChunkSize := Request.ReadClient(Buffer[BytesRead],
Request.ContentLength - BytesRead);
if ChunkSize > 0 then
begin
// --> added "[BytesRead]"
Stream.Write(Buffer[BytesRead], ChunkSize);
Inc(BytesRead, ChunkSize);
end;
// --> changed from "until ChunkSize = -1" to:
until (BytesRead = Request.ContentLength) or
(ChunkSize <= 0);
end else
Stream.Write(Request.Content[1], BytesRead);
// End fixed code
Stream.Position := 0;
You'll need to include the changed WebBrokerSOAP.PAS in your project
path.
HTH
Vincent Parrett
AtoZed Software
Email vincent [ at ] atozedsoftware dot com
-------------------------------------------------------------------
Automate your build process with FinalBuilder
IntraWeb - True RAD development for the Web
http://www.atozedsoftware.com
> I have this saved but haven't tested it myself (posted by Dave Nottage) :
Thanks. I will try.
> > Can someone guide me to the hack/solution that solves this problem?
>
> In WebBrokerSOAP.PAS:
SOAP? I am not using Borland's SOAP but mine+Microsoft's SOAP SDK.
So is there a similar fix for standard webbroker modules (IIS)?
Thanks Vincent!
See what happens when the call to ECB.ReadClient is made. (From
TISAPIRequest.ReadClient)
ie, whether the call is successful, ie whether the entire data is
returned, or whether it fails etc.
I'd guess that if ECB.ReadClient fails for no good reason, IIS is at
fault. I'd be interested to know myself <g>
--
Dave Nottage
Actually it has to be WriteClient. The server gets data ok. Is the data
returned that has 4 wrong bytes *sometimes*, after I send the response back.
I will check anyways.
Oops.. I just re-read your original message..
> Is the data returned that has 4 wrong bytes *sometimes*, after I
> send the response back.
I'd still like to know what you find <g>
--
Dave Nottage
Well, looks like the problem was hardware...
My hard disk crashed yesterday so I reinstalled everything on a new hard
disk.
No code touches. Everything works like a charm.
I am still suspicious but so far so good.
--
Alessandro Federici
System Architect
Borland Certified Consultant
http://www.msdelphi.com (home of the DSOAP Toolkit 2.0)
al...@msdelphi.com (primary)
king...@hotmail.com (secondary)
Microsoft Messenger: king...@hotmail.com
ICQ: 27692720