CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2012
    Posts
    2

    WCF and Windows Service

    Hello. Please, can somebody advise me? I create WCF library that realizes endpoint net-pipe for job with external WCF.I placed lib in Windows Service. But I dont know how to make data exchange from library without usage of WCF client-server mechanism. How can I put or get data from running WCF service? for example I want to register WCF errors in Eventlog or give parameters to service for transfer them for clients connected to WCF. Thanks a lot

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: WCF and Windows Service

    It's not clear what you are trying to do. Can you be more specific? Can you describe the architecture in more detail - what clients are connecting to what wcf services, what the services are doing, what problems you are having, etc?

  3. #3
    Join Date
    Aug 2012
    Posts
    2

    Re: WCF and Windows Service

    Thanks.
    I have two objects in my Windows Service project. One object is OPC client and database client. If i create this object in code - everything works good. Another object is WCF service library with net.pipe binding for external connection to this service. Ok. I define in my code:

    // window service class
    public partial class SyncSiemensService : ServiceBase
    {
    private OpcServiceClass opcServer = new OpcServiceClass();

    public SyncSiemensService()
    {
    InitializeComponent();
    }

    protected override void OnStart(string[] args)
    {
    // OPC client- database client object
    opsServer.Strat();

    // WCF interface for external communication
    // with this windows service
    using (ServiceHost host = new ServiceHost(typeof(DuplexPipeWcfService)))
    {
    host.Open();
    eventLog.WriteEntry("Запуск WCF интерфейса синхронного сервиса Сименс выполнено успешно", EventLogEntryType.Information);
    }
    }
    }

    WCF service

    [OperationContract(IsOneWay = true)]
    void GetActValuesFromLine(string line);

    string line - external data FOR opc object

    and his callback

    public interface IDuplexPipeWcfServiceCallback
    {
    [OperationContract(IsOneWay = true)]
    void ActualValuesUpdate(WcfDuplexActualValues value);
    }

    but "WcfDuplexActualValues value" in mine occurrence - data from OPC object for external connection in WCF. And now i dont know, how retrieve data from opc object without usage client-service communication between OPC object and WCF service library.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured