I suppose that after the HTTPRio component receives the data, it parses the data. I’m saying this because after the program leaves the AfterExecute procedure it takes ages before continuing to the next line of code.
Want I want is to clear the data that has arrived on the AfterExecute procedure. Is this possible?
procedure TEventHandlers.thhoptAfterExecute(const MethodName: string;
SOAPResponse: TStream);
var
fs : TFileStream;
begin
fs := TFileStream.Create('F:\Lixosam\LixoSMS'+
IntToStr(ThCampanha),
fmCreate, fmShareDenyNone);
SOAPResponse.Position := 0;
fs.CopyFrom(SOAPResponse, SOAPResponse.Size);
fs.Free;
end;
How can I clear the data so the component doesn’t have to do any parsing?
You can write whatever you want into the SOAPResponse. You can clear it, edit it, whatever. If a completely empty response causes trouble with deserialization (complaints about “document must have top-level element, at line 0”), you could stick in a “skeleton” response that provides minimal structure. If you edit the response, you should set the size accordingly.
Here is some code that I have: