Re: [twsocket] HttpsCli in service application

2008-10-18 Thread Arno Garrels
Paul wrote:
 I have a service application with a HtppsCli which has ran fine
 connecting to a server.
 Now, I need the HttpsCli connecting to another webservice first.
 Connecting to this new webservices runs fine, but when the HttpsCli
 connects to another webservice afterwards, it goes wrong:
 The first time it connects, I get a timeout.
 The second time, I get an errorcode=0 and a statuscode=0
 The third time it works.
 Since the client-package is stored in a single class, I have made a
 quick test in a regular program and there it runs fine.
 I have tested using NOFORMS, set multithreaded property, but that
 doesn't help.

Where to you create your class? Async or sync methods? Maybe messages
are not processed properly. Are there more threads beside main thread
and service thread? What ICS version do you use?

--
Arno
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] HttpsCli in service application

2008-10-18 Thread Paul
 Where to you create your class? 
in ServiceStart

Async or sync methods?
Async

Maybe messages are not processed properly. 
Are there more threads beside main thread and service thread? 
It's directlly in the service thread (with message loop)

What ICS version do you use?
It's still V5

Paul

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] HttpsCli in service application

2008-10-18 Thread Arno Garrels
Paul wrote:
 Where to you create your class?
 in ServiceStart
 
 Async or sync methods?
 Async
 
 Maybe messages are not processed properly.
 Are there more threads beside main thread and service thread?
 It's directlly in the service thread (with message loop)

Is TService.OnExecute assigned? 
If not, the service thread runs its message loop ProcessRequests(FALSE)
when OnStart is left, calling another message loop in OnStart won't be
a good idea. If you assigned TService.OnExecute you should show some
code.

 
 What ICS version do you use?
 It's still V5

Provided you added the old SSL-fixes to v5 posted to ICS-SSL last year
and to this list recently I have no idea what else might be wrong.
If it works in the GUI application it's likely a bug in your service
code?

--
Arno Garrels

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] HttpsCli in service application

2008-10-18 Thread Arno Garrels
Arno Garrels wrote:
 Paul wrote:
 Where to you create your class?
 in ServiceStart
 
 Async or sync methods?
 Async
 
 Maybe messages are not processed properly.
 Are there more threads beside main thread and service thread?
 It's directlly in the service thread (with message loop)
 
 Is TService.OnExecute assigned?
 If not, the service thread runs its message loop
 ProcessRequests(FALSE) when OnStart is left, calling another message

Correction: ProcessRequests(TRUE) is called.

 loop in OnStart won't be a good idea. If you assigned
 TService.OnExecute you should show some code.
 
 
 What ICS version do you use?
 It's still V5
 
 Provided you added the old SSL-fixes to v5 posted to ICS-SSL last year
 and to this list recently I have no idea what else might be wrong.
 If it works in the GUI application it's likely a bug in your service
 code?
 
 --
 Arno Garrels
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] HttpsCli in service application

2008-10-18 Thread Paul
This is the service execute :

procedure TRpUaClnt.DDServiceExecute(Sender: TDDService);
begin
  FHandle:= RpUaClnt.ServiceWindow;
  UaClient.OnDisplay:= Display;
  UaClient.StartApplication;
  while not terminated do
try
  ServiceThread.ProcessRequests(true);
except
  on E: exception do
begin
  Display('Error occured @ ' + DateTimeToStr(now) +
  ' - ' + E.Message, ntlError);
end;
end;
end;


Paul


- Original Message - 
From: Arno Garrels [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Saturday, October 18, 2008 5:07 PM
Subject: Re: [twsocket] HttpsCli in service application


 Paul wrote:
 Where to you create your class?
 in ServiceStart
 
 Async or sync methods?
 Async
 
 Maybe messages are not processed properly.
 Are there more threads beside main thread and service thread?
 It's directlly in the service thread (with message loop)
 
 Is TService.OnExecute assigned? 
 If not, the service thread runs its message loop ProcessRequests(FALSE)
 when OnStart is left, calling another message loop in OnStart won't be
 a good idea. If you assigned TService.OnExecute you should show some
 code.
 
 
 What ICS version do you use?
 It's still V5
 
 Provided you added the old SSL-fixes to v5 posted to ICS-SSL last year
 and to this list recently I have no idea what else might be wrong.
 If it works in the GUI application it's likely a bug in your service
 code?
 
 --
 Arno Garrels
 
 -- 
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] HttpsCli in service application

2008-10-18 Thread Arno Garrels
Paul wrote:
 This is the service execute :
 
 procedure TRpUaClnt.DDServiceExecute(Sender: TDDService);
 begin
  FHandle:= RpUaClnt.ServiceWindow;
  UaClient.OnDisplay:= Display;
  UaClient.StartApplication;
  while not terminated do
try
  ServiceThread.ProcessRequests(true);
except
  on E: exception do
begin
  Display('Error occured @ ' + DateTimeToStr(now) +
  ' - ' + E.Message, ntlError);
end;
end;
 end;

Looks well :-( Message loop is started properly.  
Hard to tell what might be wrong?

--
Arno Garrels 
 
 
 Paul
 
 
 - Original Message -
 From: Arno Garrels [EMAIL PROTECTED]
 To: ICS support mailing twsocket@elists.org
 Sent: Saturday, October 18, 2008 5:07 PM
 Subject: Re: [twsocket] HttpsCli in service application
 
 
 Paul wrote:
 Where to you create your class?
 in ServiceStart
 
 Async or sync methods?
 Async
 
 Maybe messages are not processed properly.
 Are there more threads beside main thread and service thread?
 It's directlly in the service thread (with message loop)
 
 Is TService.OnExecute assigned?
 If not, the service thread runs its message loop
 ProcessRequests(FALSE) when OnStart is left, calling another message
 loop in OnStart won't be a good idea. If you assigned
 TService.OnExecute you should show some code.
 
 
 What ICS version do you use?
 It's still V5
 
 Provided you added the old SSL-fixes to v5 posted to ICS-SSL last
 year and to this list recently I have no idea what else might be
 wrong. 
 If it works in the GUI application it's likely a bug in your service
 code?
 
 --
 Arno Garrels
 
 --
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] HttpsCli in service application

2008-10-18 Thread Paul
I can't image that is has something to do with the message loop.
Once connected to the second webservice, it keeps running fine.

There's a differenent behaviour between a service application and a normal 
program though.
And bebugging a service is not as easy either ..

Paul



- Original Message - 
From: Arno Garrels [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Saturday, October 18, 2008 6:54 PM
Subject: Re: [twsocket] HttpsCli in service application


 Paul wrote:
 This is the service execute :

 procedure TRpUaClnt.DDServiceExecute(Sender: TDDService);
 begin
  FHandle:= RpUaClnt.ServiceWindow;
  UaClient.OnDisplay:= Display;
  UaClient.StartApplication;
  while not terminated do
try
  ServiceThread.ProcessRequests(true);
except
  on E: exception do
begin
  Display('Error occured @ ' + DateTimeToStr(now) +
  ' - ' + E.Message, ntlError);
end;
end;
 end;

 Looks well :-( Message loop is started properly.
 Hard to tell what might be wrong?

 --
 Arno Garrels


 Paul


 - Original Message -
 From: Arno Garrels [EMAIL PROTECTED]
 To: ICS support mailing twsocket@elists.org
 Sent: Saturday, October 18, 2008 5:07 PM
 Subject: Re: [twsocket] HttpsCli in service application


 Paul wrote:
 Where to you create your class?
 in ServiceStart

 Async or sync methods?
 Async

 Maybe messages are not processed properly.
 Are there more threads beside main thread and service thread?
 It's directlly in the service thread (with message loop)

 Is TService.OnExecute assigned?
 If not, the service thread runs its message loop
 ProcessRequests(FALSE) when OnStart is left, calling another message
 loop in OnStart won't be a good idea. If you assigned
 TService.OnExecute you should show some code.


 What ICS version do you use?
 It's still V5

 Provided you added the old SSL-fixes to v5 posted to ICS-SSL last
 year and to this list recently I have no idea what else might be
 wrong.
 If it works in the GUI application it's likely a bug in your service
 code?

 --
 Arno Garrels

 --
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be
 -- 
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be
 

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] HttpsCli in service application

2008-10-18 Thread Angus Robertson - Magenta Systems Ltd
 I have a service application with a HtppsCli which has ran fine 
 connecting to a server.

Debugging service applications is a pain.  Experience has shown there are
two ideal way to write service applications with Delphi. 

1 - Write a normal windows executable, with a minimal GUI, I usually just
have a simple caption.  Essentially, any GUI application will run in the
service environment, provided it never displays a interactive dialog.
Then write a service application that runs the GUI, and sends a message
to the GUI telling it when to stop when the service is stopped.  I can
sent you such a service, I've been using them for many years, some run
for several months at a time.  The only possible issue is if the GUI
locks up and has to be stopped with Task Manager, but it's almost
impossible to crash services anyway. 

2 - Use the SvCom service environment, which allows you to create a
application that may be run as either a GUI or service.  

http://www.aldyn-software.com/svcom.html

I've used this for one new application, and it works nicely, although I
had to fix a couple of SvCom bugs to make it work.  Support is also
sporadic.  My application (ComCap) has a tick box that self installs or
deinstalls itself as a service, and allows itself to be run as a service
and GUI at the same time, with a socket sending data for display from the
service, and sending back commands. 

Sorry, don't know if Arno's DDService has the same ability, it does not
seem to be on the list, but would be a popular addition. 

My experience is that ICS behaves identically in services and GUIs, the
only development issues are allowing for different file access rights
where services don't have a logon name, or access to mapped drive letters
(without doing it themselves). 

Angus

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] HttpsCli in service application

2008-10-18 Thread Paul
I could try, but the same class runs fine in a normal application.
I've used in many services wihout problems.
Only now, it has to connect to a webservice first before connecting to an 
application server.
Logon to this application server works on de second retry (3rd try)
From then on, it works perfect ..
The only difference maybe the owner of the class.
The class has a constructor Create(AOwner: TComponent)
In the program version, I use Create(Form1)
In de service, I've tested with Create(nil) and Create(UaClient) - (service) 
with the same result

Paul



- Original Message - 
From: Angus Robertson - Magenta Systems Ltd [EMAIL PROTECTED]
To: twsocket@elists.org
Sent: Saturday, October 18, 2008 8:08 PM
Subject: Re: [twsocket] HttpsCli in service application


 I have a service application with a HtppsCli which has ran fine
 connecting to a server.

 Debugging service applications is a pain.  Experience has shown there are
 two ideal way to write service applications with Delphi.

 1 - Write a normal windows executable, with a minimal GUI, I usually just
 have a simple caption.  Essentially, any GUI application will run in the
 service environment, provided it never displays a interactive dialog.
 Then write a service application that runs the GUI, and sends a message
 to the GUI telling it when to stop when the service is stopped.  I can
 sent you such a service, I've been using them for many years, some run
 for several months at a time.  The only possible issue is if the GUI
 locks up and has to be stopped with Task Manager, but it's almost
 impossible to crash services anyway.

 2 - Use the SvCom service environment, which allows you to create a
 application that may be run as either a GUI or service.

 http://www.aldyn-software.com/svcom.html

 I've used this for one new application, and it works nicely, although I
 had to fix a couple of SvCom bugs to make it work.  Support is also
 sporadic.  My application (ComCap) has a tick box that self installs or
 deinstalls itself as a service, and allows itself to be run as a service
 and GUI at the same time, with a socket sending data for display from the
 service, and sending back commands.

 Sorry, don't know if Arno's DDService has the same ability, it does not
 seem to be on the list, but would be a popular addition.

 My experience is that ICS behaves identically in services and GUIs, the
 only development issues are allowing for different file access rights
 where services don't have a logon name, or access to mapped drive letters
 (without doing it themselves).

 Angus

 -- 
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be

 

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] HttpsCli in service application

2008-10-18 Thread Arno Garrels
Angus Robertson - Magenta Systems Ltd wrote:

 2 - Use the SvCom service environment, which allows you to create a
 application that may be run as either a GUI or service.
 
 http://www.aldyn-software.com/svcom.html
 
 I've used this for one new application, and it works nicely, although
 I had to fix a couple of SvCom bugs to make it work.  Support is also
 sporadic.  

That seems to be the nature of all russian hacks _I_ tried 
so far :(

 My application (ComCap) has a tick box that self installs
 or deinstalls itself as a service, and allows itself to be run as a
 service and GUI at the same time, with a socket sending data for
 display from the service, and sending back commands.
 
 Sorry, don't know if Arno's DDService has the same ability,
 
No it has not, it's 'simply' a extension of TService and 
TServiceAplication.
Wilfried provides a very nice example/class on his website which 
demonstrates how easy it is to run the same application as a GUI or 
as a NT service. URL: http://www.mestdagh.biz or download the source
directly from: http://www.mestdagh.biz/delphi_comp/service.zip.

--
Arno


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be