This is possible.  You need to assign an OnBeforeExecuteStream event that you use to write out the XML to a file.

The default HttpRio does not  / did not surface this event so this is what you do....

1) Create an enhanced class that does surface this event like so...

    TBeforeExecuteStreamEvent = procedure(const MethodName: string; Request: TStream) of object;

    THTTPRioEnh = Class(THTTPRIO)
    private
        fOnBeforeExecuteStream: TBeforeExecuteStreamEvent;
    protected
        procedure DoBeforeExecute (const MethodName: string; Request: TStream); override;
    published
        property OnBeforeExecuteStream: TBeforeExecuteStreamEvent read fOnBeforeExecuteStream write fOnBeforeExecuteStream;
    end;


procedure THTTPRioEnh.DoBeforeExecute(const MethodName: string;
  Request: TStream);
begin
  inherited;
    if (Assigned( fOnBeforeExecuteStream ) = True) then begin
        fOnBeforeExecuteStream( MethodName, Request );
    end;
end;


2) When you use it assign the event (I use mine to compress and encrypt data)
        fHTTPRioEnh := THTTPRioEnh.Create(nil);
        try
            fHTTPRioEnh.OnBeforeExecuteStream   := BeforeSendCompression;

3) In your event save the 'Request' Stream to file.  This is your XML.  You can also override it with anything else at this point.

Hope that helps.

Rob


On 17/09/2010 3:35 p.m., Jeremy Coulter wrote:
Hi all.
To follow on from my last email.
Is there a way I can actually view the generated XML that is transmitted by the THTTPRIO object?
This might be the best way for me to see whats going on and to make sure that there is no malformed XML etc.


Thansk Jeremy
_______________________________________________ NZ Borland Developers Group - Delphi mailing list Post: delphi@delphi.org.nz Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: unsubscribe

_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

Reply via email to