Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[K2] Getting rid of INDY continued.

0 views
Skip to first unread message

Stig Johansen

unread,
Mar 26, 2002, 1:14:18 PM3/26/02
to
Hi all.

I had some time to look at my 'HTML->SOAP' service.
I have a soap client running in a multithreaded - pooled environment, and
when it uses indy, it is not stable.

I saw a post reffering to Synapse, <http://www.ararat.cz/synapse>

I downloaded the latest source, and made the following changes in
SOAPHTTPTrans:

Added:

procedure SetupSyna(SynaHttp: THTTPSend);
var
ContentHeader, ActionHeader: string;
Protocol, Host, path, Document, Port, Bookmark: string;
begin
if (soNoValueForEmptySOAPAction in FInvokeOptions) and (SoapAction =
'') then
ActionHeader := SHTTPSoapAction + ':'
else if SoapAction = '""' then
ActionHeader := SHTTPSoapAction + ': ""'
else
ActionHeader := SHTTPSoapAction + ': ' + '"' + FSoapAction + '"';
SynaHttp.Headers.Add(ActionHeader);
SynaHTTP.MimeType := 'text/xml'; { do not localize }
SynaHttp.Protocol := '1.0' ;
end;

{$IFDEF USE_SYNA}
procedure PostData(Response: TStream);
var
SynaHTTP: THTTPSend;
WireData: string;
begin
SynaHTTP := THTTPSend.Create;
try
SetupSyna(SynaHttp);
WireData := UTF8Encode(DataMsg);
SynaHTTP.Document.Write(Pointer(WireData)^, Length(WireData));
try
SynaHTTP.HTTPMethod('POST', FURL);
Response.CopyFrom(SynaHTTP.Document, 0);
finally
end;
finally
FreeAndNil(SynaHTTP);
end;
end;
{$ENDIF}

And the following change:
{$IFDEF USE_INDY}
InitURL(FURL);
{$ENDIF}


With the above changes, everything works as expected.

But Synapse has the same 'feature' by sending the headers in small bits. So
I made the following change in HTTPSend.pas:
if FProtocol = '0.9' then
FSock.SendString(Headers[0] + CRLF)
ELSE
FSock.SendString(FHeaders.Text + CRLF);


So why do I write this?
1) To help others who might have problems using soap client in
multithreaded - pooled environments.
2) Hopefully, that upcoming patches leaves an easy choice between 3rd party
components/libraries.
3) If anyone can tell me how many of the headers, that is mandatory (
Agent,Location ...).

At last, is there any chance, that we can have a common codebase,
coordinated patch release for both D6 and K2, so one really can make
crossplatform development.
(I am thinking of properties in WSDLPublish, now the Beforeexecute in
Webnode).


--
Med venlig hilsen / Best regards
Stig Johansen
stig.j...@udvikling.it.dk
(remove dot dk)

0 new messages