We help IT Professionals succeed at work.

HTTP service only working as local host


I have an ASP.net Framework 4 website which uses a web service with simple HTTP Post & Get.

This works fine locally using localhost, but i cannot connect to it from another machine, which has lead me to belive that this is a permissions issue.

What do i need to do to allow remote machines to use the webservice?

web.config attached.

<?xml version="1.0"?>

  For more information on how to configure your ASP.NET application, please visit

    <add name="ApplicationServices"
         connectionString="Data Source=NX13-DB1;Initial Catalog=nplayer;Persist Security Info=True;User ID=nPlayer;Password=nxtera"
         providerName="System.Data.SqlClient" />

    <compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />

    <authentication mode="Forms">
      <forms loginUrl="~/Account/Login.aspx" timeout="2880" />

        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"
             enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
             maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
             applicationName="/" />

        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>

    <roleManager enabled="false">
        <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
        <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
        <add name="HttpGet"/>
        <add name="HttpPost"/>

     <modules runAllManagedModulesForAllRequests="true"/>

Open in new window

Watch Question

How are u hosting it?
On an IIS6 server
(w2k3 \ .net framework 4)
When i go into the hosts file and set localhost to the machines IP address, rather than the loopback address, it doesn't work locally, which leads me to belive that the webservice is only allowing requests from

Where can this be changed?
Are u using IIS?
Yes,  IIS6.
create new website with host header.
Add ip to host file of computer yoy are connecting from and test if this works.

Where are you chaning localhost to ip server? On server itself?
I think localhost is reserved for local. When connecting to other server use ip server of host header.
Top Expert 2010

Top Expert 2010


I've already looked at that ariticle, please note that the entries exist from line 49 on the web.config file above.

        <add name="HttpGet"/>
        <add name="HttpPost"/>

Top Expert 2010

I noticed that but just gave the link for your information. One you specify HttpGet & HttpPost in the protocols, you are normally good to go. When you are trying from another computer, is there any specific error messages/ messages that you get ?
On anything other than the localhost, when trying to use the webservice i get a HTTP 500 - Internal Server Error
So you have on server?

website in IIS with host header like test and all ip adresses

On remote computer in host file?

10.x.x.x1  test

In web.config of app consuming webservice?

service url http://test/somefile.asmx
Top Expert 2010
Refer : http://support.microsoft.com/kb/822319

Read the cause first and try the second work around .. point the application pool to the Frame work 4 in your case ...

I think this will solve your problem ...