none
Service Calling a Form with WCF interactively. RRS feed

  • Question

  • Hi,

    I have a problem here.

    I wrote a windows service which will send a notification to a dll. This dll will notify an exe form which needed to be run first using WCF and trap the messages with a pop up screen.

    1. User account to start the exe and when the service trigger the dll, the error message with 

    18/03/2014 11:27:13,[GSF.ECAOS.Notification.NotifyClient.Send],There was no endpoint listening at net.pipe://localhost/NotifyServer that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
    18/03/2014 11:27:13,[GSF.ECAOS.Notification.NotifyClient.CloseChannel],The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state.

    2. When i run it with administrator account which is starting the exe, there is no problem with that.

    p/s: Both service is using local system to run the windows service.

    I am thinking of using scheduler but can't because user account is logged on and not the admin account as it is interactively.

    :(


    regards,

    Joh

    • Moved by Caillen Monday, March 24, 2014 6:03 AM
    Friday, March 21, 2014 8:09 AM

Answers

  • The general rule is that everything web-related should run under the minimal amount of rights and permisions possible. The average html/asp/php-webserver get's it's own user account. That can do nothing but read the webservers programm and content folders. It might have write access on a dedicated temp or upload folder (logically placed under the content folder), but that is it.
    Actuall longtime storage of data is usually left to the DBMS, wich runs a seperate user wich can do little more then read and write the DB folders.

    Server programms are the single greatest security risk you can have and I already had a case where a php-script on the server was modified in a way that our server redirected everyone that came in via google to a adult page (so it was a really hard to track redirect) - via a security vulnerability in the server and not restrictive enough rights for the webserver user (he could write the servers content directory).

    If it is web-related and does not work under minimal user rights, it is propably a bad idea and does not belong into production code.
    My best guess is that the user cannot start listening for TCP-ports due to limited rights.

    Overall WCF related questiosn are best asked in the WCF and Networking forum:

    http://social.msdn.microsoft.com/Forums/en-US/home?forum=wcf


    Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2 Please mark post as helpfull and answers respectively.

    Sunday, March 23, 2014 12:11 PM

All replies

  • Just to be certain:

    You want to start/control a WinForms application that is running on a server, from a WCF service running on the same server?

    I am pretty sure WCF serices are normally barred from accessing the desktop, if they even run under the same account. I know Windows Services are barred since Vista and it would only make more sense for everything web-related (most of the times even a simple html server has the minimal rights it needs to read it's content only).

    If the WinForms applciation is already running, you can use normal interprocess communication. But I am not realyl sure what you try to do there.


    Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2 Please mark post as helpfull and answers respectively.

    Sunday, March 23, 2014 9:35 AM
  • Hi,

    thanks for your reply on this matter.

    Schedulers Tasks(Admin) --> Windows Service (Local System) --> Notifier.exe with WCF Service(admin) and this work fine.

    Schedulers Tasks(Admin) --> Windows Service (Local System) --> Notifier.exe with WCF Service(user) and this is with the mentioned errors.

    WCF client test application(user) --> Notifier.exe with WCF Service(user) and this work fine.

    BTW, all run in the same server.

    Sunday, March 23, 2014 10:24 AM
  • The general rule is that everything web-related should run under the minimal amount of rights and permisions possible. The average html/asp/php-webserver get's it's own user account. That can do nothing but read the webservers programm and content folders. It might have write access on a dedicated temp or upload folder (logically placed under the content folder), but that is it.
    Actuall longtime storage of data is usually left to the DBMS, wich runs a seperate user wich can do little more then read and write the DB folders.

    Server programms are the single greatest security risk you can have and I already had a case where a php-script on the server was modified in a way that our server redirected everyone that came in via google to a adult page (so it was a really hard to track redirect) - via a security vulnerability in the server and not restrictive enough rights for the webserver user (he could write the servers content directory).

    If it is web-related and does not work under minimal user rights, it is propably a bad idea and does not belong into production code.
    My best guess is that the user cannot start listening for TCP-ports due to limited rights.

    Overall WCF related questiosn are best asked in the WCF and Networking forum:

    http://social.msdn.microsoft.com/Forums/en-US/home?forum=wcf


    Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2 Please mark post as helpfull and answers respectively.

    Sunday, March 23, 2014 12:11 PM
  • Sunday, March 23, 2014 8:00 PM