Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Web Service as Windows Service


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 3 - Last Post: Nov 7, 2017 1:28 AM Last Post By: Hannu Laurikainen
Hannu Laurikainen

Posts: 5
Registered: 7/7/01
Web Service as Windows Service  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 26, 2017 3:38 AM
Hi All,

I try to create a web service as Windows service. Base class is inherited from TService.

class MyService : public TService
{
  . . .
}


However there is ambiguity between Soap::Wsdlbind::TService and Vcl::Svcmgr::TService. When I define class inheritance as below

class MyService : public Vcl::Svcmgr::TService
{
__published:
  void __fastcall ServiceStart(TService *Sender, bool &Started);
  void __fastcall ServiceStop(TService *Sender, bool &Stopped);
  . . .
}


Then ServiceStart and ServiceStop has ambiguity between Soap::Wsdlbind::TService and Vcl::Svcmgr::TService. How to solve this?

Thanks!
Hannu
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Web Service as Windows Service  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 26, 2017 10:36 AM   in response to: Hannu Laurikainen in response to: Hannu Laurikainen
Hannu Laurikainen wrote:

When I define class inheritance as below

class MyService : public Vcl::Svcmgr::TService

If you fully qualify the base class like that, then there is no
ambiguity.

void __fastcall ServiceStart(TService *Sender, bool &Started);
void __fastcall ServiceStop(TService *Sender, bool &Stopped);

You need to fully qualify those as well:

void __fastcall ServiceStart(Vcl::Svcmgr::TService *Sender, bool
&Started);
void __fastcall ServiceStop(Vcl::Svcmgr::TService *Sender, bool
&Stopped);


How to solve this?

Either fully qualify the class name, or don't use Soap::Wsdlbind and
Vcl::Svcmgr in the same unit.

--
Remy Lebeau (TeamB)
Hannu Laurikainen

Posts: 5
Registered: 7/7/01
Re: Web Service as Windows Service  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 30, 2017 11:51 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Hi

Thank you for your answer. Now I can compile the code without error. However it shows an error "Error in module ServiceMain: Declaration of class MyService is missing or incorrect." when I try to modify and save the code.

Hannu
Hannu Laurikainen

Posts: 5
Registered: 7/7/01
Re: Web Service as Windows Service  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 7, 2017 1:28 AM   in response to: Hannu Laurikainen in response to: Hannu Laurikainen
Hannu Laurikainen wrote:
Hi

Thank you for your answer. Now I can compile the code without error. However it shows an error "Error in module ServiceMain: Declaration of class MyService is missing or incorrect." when I try to modify and save the code.

Hannu

Any solution for this problem?

Hannu
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02