tags:

views:

17

answers:

1

Hi Everyone: We found a problem while accessing the Web service from our ASP.Net MVC project hosted in IIS 7(windows 2008), we are using this bindings.config

<basicHttpBinding>
        <binding name="BasicServiceHttpBinding">
          <security mode="TransportCredentialOnly">
            <transport clientCredentialType="Windows"/>
          </security>
        </binding>
</basicHttpBinding>

While we testing the whole application from the VS2008, everything works fine, but when we install the whole project using installer and host it under IIS, our project cannot visit the web service.

I guess the different is who own the process, while running the application under VS2008, the the ower is the current login user(domain account), but while hosting the application under IIS, the user is different (probably ./Administrator or IIS_USER rather than my domain account).

We had similar problem before while running one console application as Service, we fixed it by simply change the service owner to domain account rather than Local System account.

I am wondering can we do something similar to the project in IIS? I mean change the process owner?

and what is best way to access the server API in this scenario?

+1  A: 

Hello,

yes this is most probably problem of account permissions. This usually happens if you install ASP.NET application on one server and Web service on another and you don't change default AppPool identity for ASP.NET application.

If you need to change account used to run your ASP.NET MVC application you have to open IIS Management console and find which AppPool is running your application. Than you can change an account for that AppPool. Be aware that more applications can share single AppPool so you can affect their behavior when you change the account. If this happens you can create new application pool and assign it to just your application.

Best regards, Ladislav

Ladislav Mrnka
that is exactly what we did, many thanks for you answer.