none
Have a windows service send parameter to a web app on IIS. RRS feed

  • Question

  • I have a web app running on windows server 2012 and IIS. This windows service is a custom schedule app we built and it needs to send Job IDs to the web app. what's the best way to app the Job ID from the windows service? I was thinking one way would by to send it via a wcf web service. I know how to do the wcf services from the client where we set up everything using slsvcutil, custom proxy wrappers and custom headers, but I'm not sure that that would work on the server side.  Lastly, this is all happening on the same server machine (IIS and windows service).

    Please let me know what your thoughts are.

    Thanks.

    Tuesday, September 1, 2015 4:19 PM

Answers

  • Thanks Damienbod,  when you say "Operational Contract" it sounds like what I'm doing with slsvcutil, right? 

    A Operation Contract is the means of addressing WCF's internal methods that are exposed as public services within the WCF service. It has nothing to do with svcutil with svcutil being a proxy builder to address the WCF service on the behalf of the WCF client.

    http://www.dotnet-tricks.com/Tutorial/wcf/3ISW280913-Understanding-different-types-of-WCF-Contracts.html

    How about security concerns - we don't want this available to the outside world.  The custom headers we normally use help secure each call.

    What dictates that it has to be a WCF Web service? It can be a selfhosting WCF service using named pipe,  MSMQ or TCP with MSMQ and TCP WCF service  being hosted on a cheap machine on the protected LAN that can be consumed by the WCF client  that has access on the LAN. It could be a console application that is hosting the WCF service, it can be a Windows form exe that has all logic for forms ripped out so that it an exe with no forms.

    http://www.codeproject.com/Articles/515253/Service-Oriented-Architecture-and-WCF

    Tuesday, September 1, 2015 5:06 PM

All replies

  • what's the best way to app the Job ID from the windows service?

    If you know WCF, then you would use an Operational Contract with a method that accepts a List<T> of ID(s) in string format or int. The Operational contract will pass the List<T> on to a method in the service that process the List<T>.

    You can also use ASP.NET WebAPI, which is simple restful service easy to setup and use where you can pass a list of ID(s) on the URL as  parms.

    https://damienbod.wordpress.com/2014/08/22/web-api-2-exploring-parameter-binding/

    Tuesday, September 1, 2015 4:35 PM
  • Thanks Damienbod,  when you say "Operational Contract" it sounds like what I'm doing with slsvcutil, right?  How about security concerns - we don't want this available to the outside world.  The custom headers we normally use help secure each call.
    Tuesday, September 1, 2015 4:43 PM
  • Thanks Damienbod,  when you say "Operational Contract" it sounds like what I'm doing with slsvcutil, right? 

    A Operation Contract is the means of addressing WCF's internal methods that are exposed as public services within the WCF service. It has nothing to do with svcutil with svcutil being a proxy builder to address the WCF service on the behalf of the WCF client.

    http://www.dotnet-tricks.com/Tutorial/wcf/3ISW280913-Understanding-different-types-of-WCF-Contracts.html

    How about security concerns - we don't want this available to the outside world.  The custom headers we normally use help secure each call.

    What dictates that it has to be a WCF Web service? It can be a selfhosting WCF service using named pipe,  MSMQ or TCP with MSMQ and TCP WCF service  being hosted on a cheap machine on the protected LAN that can be consumed by the WCF client  that has access on the LAN. It could be a console application that is hosting the WCF service, it can be a Windows form exe that has all logic for forms ripped out so that it an exe with no forms.

    http://www.codeproject.com/Articles/515253/Service-Oriented-Architecture-and-WCF

    Tuesday, September 1, 2015 5:06 PM