Results 1 to 6 of 6

Thread: [RESOLVED] Want to use browser to communicate with running background executable

  1. #1

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Resolved [RESOLVED] Want to use browser to communicate with running background executable

    I want to use a browser to communicate with running background executable - kind of like how a browser is used to control a sophisticated copier on an office network.

    Can I open a web page from a "local" .html file - similar to how my public facing webpages are served up by IIS?

    Then once the page is loaded - being that it's jQuery - can I use AJAX to talk to executables running on the same machine? How would the executable open a port that the jQuery ajax could talk to??

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Want to use browser to communicate with running background executable

    If the executable provides a HTTP interface, you could talk to it using asynchronous GET/POST requests.
    If it doesn't, you could build an HTTP interface which acts as a proxy, translating the HTTP requests into commands sent over TCP/IP or whatever other means you have of controlling the service.

    Bear in mind that browsers prevent requests from being made across domains (although I forget if any browsers relax this restriction for file:// pages) so whatever HTTP interface you use will have to be served from the same host as the webpage.

  3. #3

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Want to use browser to communicate with running background executable

    I am in early design stages here - so I'm just looking for good ideas...

    I have found JSON to be a great protocol for packing data for transmission - so I started thinking that I would use JSON over TCPIP for communication between my different executables...

    Then I thought - why not use a webpage as the console app for these services.

    By the "across domain" issue - do you mean I cannot talk from my workstation - using a browser - to a server on the DOMAIN running my executables?

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Want to use browser to communicate with running background executable

    Quote Originally Posted by szlamany View Post
    By the "across domain" issue - do you mean I cannot talk from my workstation - using a browser - to a server on the DOMAIN running my executables?
    You can, if the same server that talks to the executable also serves the webpage that you view on your workstation.
    AJAX requests must go to the same hostname, protocol, and port as the original webpage.

  5. #5

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Want to use browser to communicate with running background executable

    Ok - so each executable on whatever server it runs on must serve up the page (is that the HTTP interface??) and that page can talk to the server.

    How do I go about making an HTTP interface?

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  6. #6

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Want to use browser to communicate with running background executable

    I used an Httplistener in this thread

    http://www.vbforums.com/showthread.p...19#post4110619

    Marking this thread closed!

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width