Odeslat dotazOdeslat dotaz
 

OdpovědětHosting WCF services in a live enviornment

  • 4. července 2009 10:01Fleur Dunbar Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     
    I am trying to create a service to be exposed over the net.
    1. After creating the service how do you make it available for use from other PCs? I do not have a server as yet but my PC is always on.
    2. I need the service to be able to reply to all logged in users when a user send a message. How do I do that please? (e.g. a user loogs in and all users need to receive a message saying "New user has logged in.")

    Can anyone help?

Odpovědi

  • 5. července 2009 16:22Stipe-Ivan Latkovic Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     Odpovědět
    Hi Fleur,

    without a static IP, you should use some dynamic dns service, e.g. DynDNS. Regarding the other question, you should use duplex communication and mantain a list of client callback channels (and just iterate through that list when some event occurs, i.e. when new user logs in).

    Regards,
    John
  • 5. července 2009 18:13dsandor Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     Odpovědět
    Hi Fleur,

    You will probably need to provide more information but here is a starting point.

    1) You need to 'host' the service somewhere.  On your computer is one choice.  If this is your choice you need to install a web server that supports the .NET framework 3.5.  If you have a MS OS (XP, Vista, etc) you just need to install IIS (Start | Control Panel | Add Remove Programs (XP), Programs and Features (Vista) | Windows Compoenents (XP), Turn On or Off Windows Features (Vista)

    Navigate down to the IIS section and install the components (If you are a novice please read firewall guides on how to expose your WCF service to the internet and continue to protect your computer- e.g. Port Forwarding.)

    2) Are 'all users' all the users logged in to the local COMPUTER as in a terminal service configured server (multiple people logged in to the same machine).  Or, are you saying that all computers subscribing to the service need to see when any other subscriber logs on.  I will assume the second but they are much the same.

    First, you will need a program that consumes the service that runs when a user logs on (place the program in the startup group).  Next that program will need to:

    a) send a message to the WCF service via a method telling it that a user logged on and the user's name or whatever.
    b) poll the WCF service on a periodic basis to see if there are any new messages since the last message it received.  If there are: display the new message.

    Hope this is a good start.  Explaining your goals in more detail will result in a better answer.

    David Sandor


    Mark the best replies as answers!

Všechny reakce

  • 5. července 2009 16:22Stipe-Ivan Latkovic Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     Odpovědět
    Hi Fleur,

    without a static IP, you should use some dynamic dns service, e.g. DynDNS. Regarding the other question, you should use duplex communication and mantain a list of client callback channels (and just iterate through that list when some event occurs, i.e. when new user logs in).

    Regards,
    John
  • 5. července 2009 18:13dsandor Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     Odpovědět
    Hi Fleur,

    You will probably need to provide more information but here is a starting point.

    1) You need to 'host' the service somewhere.  On your computer is one choice.  If this is your choice you need to install a web server that supports the .NET framework 3.5.  If you have a MS OS (XP, Vista, etc) you just need to install IIS (Start | Control Panel | Add Remove Programs (XP), Programs and Features (Vista) | Windows Compoenents (XP), Turn On or Off Windows Features (Vista)

    Navigate down to the IIS section and install the components (If you are a novice please read firewall guides on how to expose your WCF service to the internet and continue to protect your computer- e.g. Port Forwarding.)

    2) Are 'all users' all the users logged in to the local COMPUTER as in a terminal service configured server (multiple people logged in to the same machine).  Or, are you saying that all computers subscribing to the service need to see when any other subscriber logs on.  I will assume the second but they are much the same.

    First, you will need a program that consumes the service that runs when a user logs on (place the program in the startup group).  Next that program will need to:

    a) send a message to the WCF service via a method telling it that a user logged on and the user's name or whatever.
    b) poll the WCF service on a periodic basis to see if there are any new messages since the last message it received.  If there are: display the new message.

    Hope this is a good start.  Explaining your goals in more detail will result in a better answer.

    David Sandor


    Mark the best replies as answers!