Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6536043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:26:41+00:00 2026-05-25T10:26:41+00:00

I have a console application I wrote in C# that polls multiple devices, collects

  • 0

I have a console application I wrote in C# that polls multiple devices, collects some data, and stores the information on a database. The application runs on our web server, and I was wondering how to invoke a method call from the command console (so I can exec a command from php that will be read by the console application, a shell command would work as well).

Anyone got any ideas? I’ve been floating around ‘the google’ and have found nothing that will supply my current needs.

Also, i’m not adverse to making changes to the console application if an overhaul is needed there. Please, if your answer is COM Interop, provide a GOOD example of how I would build and call this from PHP / Apache2.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:26:42+00:00Added an answer on May 25, 2026 at 10:26 am

    You could create a Service like this:

    [ServiceContract]
    public interface IService
    {
        [OperationContract]
        [WebInvoke(
          Method = "GET",
          UriTemplate = "/magic")]
        void MagicMethod();
    
    }
    

    And a service implementation like this:

    public class Service : IService
    {
        public void MagicMethod()
        {
            //magic here
        }
    }
    

    to start a HTTP Service it should look like this:

    WebServiceHost host = new WebServiceHost(typeof(Service), new Uri("http://127.0.0.1:8080"))
    ServiceEndpoint ep = host.AddServiceEndpoint(typeof(IService), new WebHttpBinding(), "");
    ServiceDebugBehavior stp = host.Description.Behaviors.Find<ServiceDebugBehavior>();
    
    stp.HttpHelpPageEnabled = false;
    host.Open();  
    

    This will start a HTTP server on port 8080.
    Then you can make a HTTP Get request to ‘http://localhost:8080/magic’ to invoke the method call.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have console application. In that i have some process that fetch the data
We have a certain database that has some employee information, and I just wrote
I have a console application that require to use some code that need administrator
I could use some suggestions / ideas. I wrote a console application that queries
I have a console application that extracts data from a SQL table to a
Say I have a console application that runs on Machine1. What is happening in
I have a simple console application that runs calculations in several threads (10-20 of
I added a table to a database that my application uses and wrote some
I have a console application that I didn't write. Is there some easy way
I have a console application project in C# 2.0 that needs to write something

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.