Solved

ASP.NET-to-WinService communication?

Posted on 2006-06-29
4
243 Views
Last Modified: 2010-05-18
I have a Windows Service (myZOOMservice) running on ServerOMEGA (like a daemon). I have an IIS ASP.NET application running on ServerALPHA. From inside ASPX form code, how do I send an "OkDoItNow!" message to myZOOMservice? The ASPX does not pass data to myZOOMservice, nor does the ASPX need data returned from myZOOMservice. The communication is one-direction - from ServerALPHA.ASPX to ServerOMEGA.myZOOMservice - and it simply triggers a predefined action in myZOOMservice.

I don't even know where to start reading or looking.
0
Comment
Question by:volking
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 23

Expert Comment

by:Jens Fiederer
ID: 17010495
This depends very heavily on myZOOMservice.

Does it already accept messages, and, if not, can you change myZOOMservice?
0
 
LVL 5

Author Comment

by:volking
ID: 17011332
Yes, I wrote myZOOMservice using Visual Studio, a Windows Service project, and C#.
I can make myZOOMservice do anything. At least anything you can help me do (smile)

0
 
LVL 23

Accepted Solution

by:
Jens Fiederer earned 500 total points
ID: 17011819
One approach is to use Remoting.

In the service (I was using VB, but C# is almost identical if you add a few semicolons:)
Also provide the MyFunction to do what is needed:

     Public Shared Sub Main()
        m_sAppServerPort = 9988 ' port number

        Dim provider As New BinaryServerFormatterSinkProvider
        provider.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full
        Dim props As IDictionary = New Hashtable
        props("port") = m_sAppServerPort
        m_objChannel = New TcpChannel(props, Nothing, provider)
        ChannelServices.RegisterChannel(m_objChannel)
        Remotable.Remoting.RegisterSingleCall(GetType(Myfunction), "App/Function")
    End Sub

In the client:
        Dim provider As New BinaryServerFormatterSinkProvider
        provider.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full
        Dim props As IDictionary = New Hashtable
        props("port") = 0
        m_objChannel = New TcpChannel(props, Nothing, provider)
        ChannelServices.RegisterChannel(m_objChannel)
        RemotingConfiguration.RegisterWellKnownServiceType(GetType(MyFunction), YourURL, WellKnownObjectMode.SingleCall)

and then you can just call MyFunction in your code to get things started.



0
 
LVL 5

Author Comment

by:volking
ID: 17013334
Cool ... I will try it ... later
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question