Creazione di un servizio windows server

giovedì 02 aprile 2015 - 12.56

massimopasquali Profilo | Newbie

Buongiorno,

devo creare un servizio windows server con visual studio 2013.

Lo scopo del servizio è quello di lanciare dei metodi specifici su richiesta.
In pratica da Microsoft Dynamic NAV2013 R2 devo istanzionare una classe DOT.NET che farà riferimento al servizio windows server, eseguito il medoto il mio servizio farà una chiamata ad un webservice esterno rimanendo in attesa della rispsota, una volta ricevuta, andrà, tramite apposito metodo, a scrivere sul DB l'informazione ricevuta.

La domanda è : è possibile aggiungere metodi con scopi specifici? pubblico il codice del mio primo servizio


namespace IperutilityServiceSgate
{
public partial class ServiceIperutilitySgate : ServiceBase
{
SgateDIGAS DIGAS;
SGATEProxy SGATE;
public string pathCertificati;
public string certificatoPFX;
public string certificatoSGATE;
public string certificatoGeoTrustPCA;
public string GeoTrustEV;
public string username;
public string password;

public ServiceIperutilitySgate(string pathCertificati, string certificatoPFX, string certificatoSGATE, string certificatoGeoTrustPCA, string GeoTrustEV, string username, string password)
{
InitializeComponent();
// in this point I'll calling at DLL-SGATE
this.pathCertificati = pathCertificati;
this.certificatoPFX = certificatoPFX;
this.certificatoSGATE = certificatoSGATE;
this.certificatoGeoTrustPCA = certificatoGeoTrustPCA;
this.GeoTrustEV = GeoTrustEV;
this.username = username;
this.password = password;
DIGAS.PresaIncaricoLottoVersoSGATE();
}

protected override void OnStart(string[] args)
{
SGATE = new SGATEProxy(this.pathCertificati, this.certificatoPFX, this.certificatoSGATE, this.certificatoGeoTrustPCA, this.GeoTrustEV, this.username, this.password);
DIGAS = new SgateDIGAS();
}

protected override void OnStop()
{
}
}
}


Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5