none
Difference between 127.0.0.1 and machine IP(XXX.XXX.XXX.XXX)

    Question

  • Hi,

    I am hosting a wcf service on my machine. I am trying to access it using 127.0.0.1. I am able to access it. Then, I try to access it using the actual machine IP. This time it doesn't work. It gives a CommunicationException stating that it cannot connect to the service. I am using net tcp binding.

    Is there any difference in the way WCF handles 127.0.0.1 and actual machine IP (like xxx.xxx.xxx.xxx)?


    Thanks in advance.


    Regards,
    Praveen.
    Praveen Gurrapu
    Wednesday, January 07, 2009 6:06 AM

Answers

  • Hi All,


    Thank you very much for your response. I have found that I have given the address in the application configuration file of the host as 127.0.0.1 instead of "localhost". Now, when I revert it back to "localhost", it works with my static IP as well as 127.0.0.1. So, my problem is solved :).


    Thank you all,


    Regards,
    Praveen.
    Praveen Gurrapu
    Tuesday, February 24, 2009 7:19 AM

All replies

  • Interesting

    127.0.0.1 is the loopback address which is not addressable from another machine and so is a different physical IP address from the actual machine IP so I can understand it failing. The weird thing is it works with the wsHttpBinding or basicHttpBinding so the HTTP infrastructure must do something special here

    Regards

    Richard Blewett
    http://www.dotnetconsult.co.uk/weblog2
    Wednesday, January 07, 2009 7:53 AM
    Moderator
  • Hi Praveen!
    Hope you are good. Well yes there is difference, When you access your system with loopback address it runs on local intranet zone whereas when you access it through actual machine IP it runs on Internet Zone. So there may be rights/access/policy issues. Actually on 127.0.0.1 its not even following protocols properly.

    If you can paste here complete exception we will have more clear picture. If you want to have idea on Security Zones you may want to visit the link http://support.microsoft.com/default.aspx/kb/174360

    Please feel free to discuss further 

    Thanks,
    Adil
    • Proposed as answer by Adil MughalMVP Thursday, January 08, 2009 2:46 PM
    Wednesday, January 07, 2009 4:32 PM
  • Hi All,


    Thank you very much for your response. I have found that I have given the address in the application configuration file of the host as 127.0.0.1 instead of "localhost". Now, when I revert it back to "localhost", it works with my static IP as well as 127.0.0.1. So, my problem is solved :).


    Thank you all,


    Regards,
    Praveen.
    Praveen Gurrapu
    Tuesday, February 24, 2009 7:19 AM