Re: HTTPserver source 10.1.5 compiled with Indy 10.5.5 not working

Giganews Newsgroups
Subject: Re: HTTPserver source 10.1.5 compiled with Indy 10.5.5 not working
Posted by:  Remy Lebeau \(Indy Team\) (re…@lebeausoftware.org)
Date: Mon, 1 Nov 2010

"Henk van den Boogaard" <henk…@boogaard-berging.nl> wrote in message
news:AF6A4A4717C4E340henk…@boogaard-berging.nl...

>  Strm := TStringStream.Create;

In D2010, TStringStream is Unicode-enabled, and will attempt to
encode/decode string data between Ansi and Unicode, which may alter the XML
you load.  You should use a TMemoryStream instead so the XML is transmitted
as-is.

>  Memo1.Lines.Add('Notification:');
>  Memo1.Lines.Add(ARequestInfo.FormParams);

TIdHTTPServer is a multi-threaded component.  The OnCommand... events are
fired in the context of worker threads.  Accessing GUI components from
outside the context of the main thread is not safe.  Use TIdSync or
TIdNotify to access/update the GUI safely.

>    strWrite.Add(ARequestInfo.FormParams+'&cmd=_notify-validate');

In newer versions of Indy 10, the ARequestInfo.FormParams property is only
filled in for "application/x-www-form-urlencoded" requests now, which your
client is not sending to your server (it is sending a "text/xml" request
instead).  That was not the case in older Indy 10 versions.

> When sending the file '1.XML' I see in the compiled version (with Indy
> 10.1.5) my data from '1.XML' in the memo.

That was due to an old bug that was fixed a long time ago.

> If I compile de program with Indy 10.5.0 I do not see the data from
> '1.XML'.

Because you are looking in the wrong place.  You need to use the
ARequestInfo.PostStream property to access the posted data.

--
Remy Lebeau (Indy Team)

Replies

In response to

HTTPserver source 10.1.5 compiled with Indy 10.5.5 not working posted by Henk van den Boogaard on Fri, 29 Oct 2010