Wednesday, March 16, 2005

SOAP bug fix: changes to request don't get recorded.

Delphi 7 and 2005 have an issue in the SOAP client area - if you change the XML in the OnBeforeExecute Event of THTTPRio, the change doesn't get recorded (i.e. the original XML gets sent no matter what you do) That's not intended, since the event gives you a "var" parameter.

A fix for this is to add this in RIO.Pas, in the DoBeforeExecute procedure, AFTER the following line:

{ NOTE: We ignore the var WideString passed in... ???? }

add:

 
// DEEPAK
Req := ReqW;

StrStrm := TStringStream.Create(Req);
try
StrStrm.Position := 0;
Request.CopyFrom( StrStrm, 0 );
finally
StrStrm.Free;
end;

{note: Declare Req:string and StrStrm: TStringStream; as local
variables}

Ah, yes, and I'm a married man now. Sunila and I tied the knot a couple weeks back, and I'll post a link to the photos soon.