Article View: borland.public.cppbuilder.webservices.soap
Article #45Re: C++ builder 6 and web service
From: Jean-Marie Babet
Date: Thu, 03 Jul 2008 20:06
Date: Thu, 03 Jul 2008 20:06
41 lines
2490 bytes
2490 bytes
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
Technical Details
Message-ID:
<486d2fe2$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder.news-service.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<486b804a$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: "Jean-Marie Babet" <bbabet@borland.com> Newsgroups: borland.public.cppbuilder.webservices.soap References: <486b804a$1@newsgroups.borland.com> Subject: Re: C++ builder 6 and web service Date: Thu, 3 Jul 2008 13:06:31 -0700 Lines: 43 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 NNTP-Posting-Host: 10.143.51.162 Message-ID: <486d2fe2$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1215115234 10.143.51.162 (3 Jul 2008 13:00:34 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder.news-service.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail