Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ASP.NET-to-WinService communication?

Posted on 2006-06-29
4
Medium Priority
?
244 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 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

730 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