🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.webservices.soap
Article #46

Re: C++ builder 6 and web service

#46
From: max
Date: Fri, 04 Jul 2008 14:44
52 lines
2972 bytes
"Jean-Marie Babet" <bbabet@borland.com> wrote:
>Hello Mg,
>
>I'm not sure if the CBuilder 6 version of the component exposed the timeout
>properties back then. Basically we use WinInet for the HTTP transport and
>the latter has APIs to set the timeout. You may need to change your copy of
>SOAPHTTPTrans.pas directly to add this functionality and then build with
>that .pas file or with an .obj created from that .pas. The logic must be
>added to THTTPReqResp.Send as follows:
>
>
>Request := nil;
>  try
>    Request := HttpOpenRequest(FInetConnect, 'POST', PChar(FURLSite), nil,
>      nil, Pointer(AcceptTypes), Flags, Integer(Self));
>    Check(not Assigned(Request));
>
>   {Here's the code added for timeout support }
>    if _ConnectTimeout > 0 then
>      Check(not InternetSetOption(Request, INTERNET_OPTION_CONNECT_TIMEOUT,
>Pointer(@_ConnectTimeout), SizeOf(_ConnectTimeout)));
>    if _SendTimeout > 0 then
>      Check(not InternetSetOption(Request, INTERNET_OPTION_SEND_TIMEOUT,
>Pointer(@_SendTimeout), SizeOf(_SendTimeout)));
>    if _ReceiveTimeout > 0 then
>      Check(not InternetSetOption(Request, INTERNET_OPTION_RECEIVE_TIMEOUT,
>Pointer(@_ReceiveTimeout), SizeOf(_ReceiveTimeout)));
>    {End of code added for timeout support }
>
>    { SOAPAction header }
>    ActionHeader:= GetSOAPActionHeader;
>    HttpAddRequestHeaders(Request, PChar(ActionHeader),
>Length(ActionHeader), HTTP_ADDREQ_FLAG_ADD);
>
>
>In later versions _ConnectTimeout, _SendTimeout and _ReceiveTimeout are
>fields of the class [with the leading '_' as 'F']. In your case you can have
>them as global variables that you can set as needed.
>
>Cheers,
>
>Bruneau
>
>
Thanks a lot.

I've modified has you say, but some question. 
[1]
You said "...and then build with that .pas file or with an .obj created from that .pas...". What means? I must include that .pas in my project and then build all, or what?
[2]
You said "...In your case you can have them as global variables that you can set as needed...". What means? I must set these variables in file SOAPHTTPTrans.pas before build my project or where?
Technical Details
Message-ID: <486e3743$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!feeder.erje.net!news.isoc.lu!newsgroups.borland.com!not-for-mail
References: <486b804a$1@newsgroups.borland.com> <486d2fe2$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11096a,a85ea4775287740b
X-Google-Attributes: gid11096a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "max" <maxg1972@gmail.com>
Sender: "max" <maxg1972@gmail.com>
Reply-To: "max" <maxg1972@gmail.com>
Subject: Re: C++ builder 6 and web service 
Newsgroups: borland.public.cppbuilder.webservices.soap
X-User-Info: 217.133.12.249     
References: <486b804a$1@newsgroups.borland.com> <486d2fe2$1@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <486e3743$1@newsgroups.borland.com>
Date: 4 Jul 2008 07:44:19 -0700
X-Trace: newsgroups.borland.com 1215182659 207.105.83.66 (4 Jul 2008 07:44:19 -0700)
Lines: 53
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!feeder.erje.net!news.isoc.lu!newsgroups.borland.com!not-for-mail