locked
Windows Service For SQL Server Backup RRS feed

  • Question

  • Hi, I have created the windows service completely but I coun't find out that how can i call the compiled class like named:"Archive" from service.

    thanks a lot.

    Thursday, August 2, 2007 6:50 AM

Answers

  • Hi Utku,

     

    Assuming the Windows Service and compiled class are written in C#.

    Then, we can call the class from windows service in normal process.

     

    1. Add Reference: choosing your dll including the compiled class

    2. Add namespace declaration: Using Mydll;

    3. Call class and method in Windows Service programe

     

    If I have misunderstood, please let me know.

     


    Best Regards,

    Martin Xie

    Monday, August 6, 2007 9:26 AM
  • Oh Utku, I see. "Without opening the application" meant the web service.

     

    But a Web Service is different from a common Class Library. If we want to call webservice methods, the Web Service must be running first. Because the Web Service is similar to a remote website deployed on server. Only starting and running, it can supply services.

     

    Thank you for your active participation in this forum!

    If you have any difficulties in future developing, please feel free to come back.

     

    Best Regards,

    Martin Xie

    Thursday, August 9, 2007 5:53 AM

All replies

  • Hi Utku,

     

    Assuming the Windows Service and compiled class are written in C#.

    Then, we can call the class from windows service in normal process.

     

    1. Add Reference: choosing your dll including the compiled class

    2. Add namespace declaration: Using Mydll;

    3. Call class and method in Windows Service programe

     

    If I have misunderstood, please let me know.

     


    Best Regards,

    Martin Xie

    Monday, August 6, 2007 9:26 AM
  • Hi Utku,

     

    If you still have any issue, please provide detail infomation so that we troubleshoot it and do our best to resolve it.

    e.g.

    what's the programing language you used?

    What code did you try?

    Which step did you encounter error?

     

    Thanks,

    Martin

    Wednesday, August 8, 2007 9:08 AM
  •  

    Hi Martin, No I solved my problem, I am using c#.NET and I added "WEB Reference" to the service project. By the help of the timer every time it call the methods from the web service. But only i couldn't find the way of how to call that methods without running the application. I mean is it possible to use that code without running the application?

     

    thanks martin.Smile)

    Wednesday, August 8, 2007 10:47 AM
  •  Utku Selamoğlu wrote:

    Hi Martin, No I solved my problem, I am using c#.NET and I added "WEB Reference" to the service project. By the help of the timer every time it call the methods from the web service. But only i couldn't find the way of how to call that methods without running the application. I mean is it possible to use that code without running the application?

     

    Hi Utku,

    I'm glad to hear that you have solved your problem. 

    Thank you for your quick feedback!

     

    I understand that your Windows Service project references a Web Service, a Timer in the Windows Service calls web service methods. Right?

     

    But I'm confused on the words "without running the application". Did you mean the Windows Service or Web Service?

     

    If you don't want to call webservice methods via the Timer in your Windows Service, you can manually call it in IE browser like so.

     

    http://URL/WebService1/ServiceName.asmx  Visit Web Service and list all methods

     

    http://URL/WebService1/Service.asmx?op=MethodName  Call a method in the Web Service

     

     

    If I have misunderstood, please let me know.

     

    Thanks,

    Martin

     

     

    Wednesday, August 8, 2007 12:26 PM
  • Hi Martin, yes i want to use webservice as a webreference but i can not use the method in the webservice without running the application. i want that windows service does its job without opening the application. i think this time you have undertandSmile)

    Wednesday, August 8, 2007 12:33 PM
  • Oh Utku, I see. "Without opening the application" meant the web service.

     

    But a Web Service is different from a common Class Library. If we want to call webservice methods, the Web Service must be running first. Because the Web Service is similar to a remote website deployed on server. Only starting and running, it can supply services.

     

    Thank you for your active participation in this forum!

    If you have any difficulties in future developing, please feel free to come back.

     

    Best Regards,

    Martin Xie

    Thursday, August 9, 2007 5:53 AM
  • Martin, itis okey now. i carried the methods from web service - inside the service classSmile)) but i changed lots of things. Anyway, thank you for your help.

     

    Utku Selamoğlu

    Thursday, August 9, 2007 6:01 AM