Best way of exposing an interface to a service for a local UI
-
Hello, I haven't posted on here but before but I've been a reader for a while. I've just switched jobs and taken up the role of developer so I was hoping you good people could give me a bit of advice on the best way to go about designing a solution. I have been given an existing application that runs as a windows service. Currently, this application simply provides a wrapper to control some telephony hardware, managing messaging queues, that sort of thing. It returns some real time information such as delivery reports and failure reports and currently there are only limited options to interact with it (text file input directories or direct database interaction, neither of which are ideal). The service can be extended using the api to write service extension dlls. Here's what I need to do. I want to create an interface to the service so that I can have a heavyweight local winforms UI manage it, as well as allowing a very limited web interface to interact with it eventually (though that is not the priority). I want the level of access allowed to the winforms UI to be much greater than that allowed by web interface later on. Here's the question - what's the best practice for exposing my service. Do I extend it with a web service and simply have different levels of functionality available on different ports, then communicate with my local service as if it was a remote service from my winform application? (I'm a little worried about whether this will provide the appropriate level of real time event handling). Or is there a better way of approaching this and exposing my windows service to a local winform UI? Also, are any of the relatively recently released Application Blocks or Software Factories applicable to this development? I noted the web service factory has just come out and might be worth a look. Any help and advice appreciated. Thanks, Adam
-
Hello, I haven't posted on here but before but I've been a reader for a while. I've just switched jobs and taken up the role of developer so I was hoping you good people could give me a bit of advice on the best way to go about designing a solution. I have been given an existing application that runs as a windows service. Currently, this application simply provides a wrapper to control some telephony hardware, managing messaging queues, that sort of thing. It returns some real time information such as delivery reports and failure reports and currently there are only limited options to interact with it (text file input directories or direct database interaction, neither of which are ideal). The service can be extended using the api to write service extension dlls. Here's what I need to do. I want to create an interface to the service so that I can have a heavyweight local winforms UI manage it, as well as allowing a very limited web interface to interact with it eventually (though that is not the priority). I want the level of access allowed to the winforms UI to be much greater than that allowed by web interface later on. Here's the question - what's the best practice for exposing my service. Do I extend it with a web service and simply have different levels of functionality available on different ports, then communicate with my local service as if it was a remote service from my winform application? (I'm a little worried about whether this will provide the appropriate level of real time event handling). Or is there a better way of approaching this and exposing my windows service to a local winform UI? Also, are any of the relatively recently released Application Blocks or Software Factories applicable to this development? I noted the web service factory has just come out and might be worth a look. Any help and advice appreciated. Thanks, Adam
NamelessParanoia wrote:
what's the best practice for exposing my service
Don't think that exists. It is largely dependent on the specifics of your service and applications. Based on my best understanding of what you posted I will offer this potential solution. Extend the service with a dll that exposes Remoting Service(s) then in either a winforms or a ASP.NET applications you can use the remote proxies to access the Service process. It is quite simple and supports security. I recommend the book Professional C#[^] for it's coverage of Remoting.
led mike
-
NamelessParanoia wrote:
what's the best practice for exposing my service
Don't think that exists. It is largely dependent on the specifics of your service and applications. Based on my best understanding of what you posted I will offer this potential solution. Extend the service with a dll that exposes Remoting Service(s) then in either a winforms or a ASP.NET applications you can use the remote proxies to access the Service process. It is quite simple and supports security. I recommend the book Professional C#[^] for it's coverage of Remoting.
led mike
Thanks for the response Led, I've been having a much more thorough look into using remoting today and came across this MSDN article that pretty much answers my question: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/bdadotnetarch16.asp There's an architecture section at the end that shows the reasons for the different selections to be made. Best Regagrds, Adam
-
Thanks for the response Led, I've been having a much more thorough look into using remoting today and came across this MSDN article that pretty much answers my question: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/bdadotnetarch16.asp There's an architecture section at the end that shows the reasons for the different selections to be made. Best Regagrds, Adam
Yes I know that article but did not link to it since your architecture (having an existing service) is not very well represented in the article. Since you already have a Service that contains the information you want to publish to a .NET Windows Forms application, adding remoting services to the existing service seems like the simplest and relatively efficient solution.
led mike