ASP MVC 4 and Webservice

Asked

Viewed 1,249 times

2

I have a Webservice with all the methods I need to make the system work and I also have a page ASP NET MVC 4. I already referenced the Webservice Referral Service. I can access a method that returns a simple string, but when I call a Webservice method that requests to the database(insert) it returns an error to me: System.Data.EntityException: O provedor subjacente falhou em Open. ---> System.Data.SqlClient.SqlException: Falha de logon do usuário 'IIS APPPOOL\\ApPizza'.\n em System.Data.SqlClient.SqlInternalConnection.OnE.... I searched and found something like this: you’re not doing the IIS user impersonate.

I was wondering if there are any settings I should do. Both on the Web.Config and the entire project.

  • There’s a way you can get past your Connectionstring ?

  • My connectionString is at Webservice which is hosted at IIS

  • If you do not pass the settings and how is your Web Service project difficult to opine !!!

1 answer

1

  • Log in to SQL Server Management Studio;
  • Log in to your server;
  • Go in the folder Security > Logons;
  • Right-click > Novo Logon;
  • Under Login Name, click Research;
  • Typo IIS APPPOOL\ApPizza and click on OK;
  • Click on Mapeamentos de Usuário and set base permissions;
  • Click on OK
  • In SQL Server Managemant Studio the security folder has Logons. We tried to do what you said and returned an error: It was not possible to locate an object (User or Internal Security Entity) called "ISS APPPOOL Appizza"

  • @Thiagoalex, Test registering another user on SQL Server, then inform him in your connectionString with the User Id and Password.

  • @Thiagoalex You’re right. I took a few wrong steps. I edited the answer. Try to locate the user with one bar. It should work now.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.