-1

I am trying to consume a c# web service in a c++ windows service application. I first wrote a c++ VCL forms app and consumed the web service using WSDL importer. This worked perfectly and gave me access to all the web methods. Then I wrote the c++ service application and again used WSDL importer to import the web service. The c++ service compiles and I can install the service, but as soon as I use any of the web methods the service hangs.

I cannot find any information online regarding service applications and web services - is it even possible to import a web service to a windows service application? Can anyone explain if this is possible and how to do it?

Mohit Jain
  • 30,259
  • 8
  • 73
  • 100
Mica
  • 1
  • 2

1 Answers1

0

I found an answer to my problem. Just to clarify I consumed a c# asmx web service inside a c++ windows service using WSDL. The only reason it didn't work was because I forgot to initialize the COM subsystem for the thread. I added the following line to my code and it now works perfectly: CoInitializeEx(NULL, COINIT_MULTITHREADED);

Mica
  • 1
  • 2