Search code examples
c#asp.netwcfiiswcf-rest

Getting "Request Error" after hosting WCF on IIS


Before hosting WCF Restful Services on IIS. I was getting response from server in my android application but now I have hosted my services on IIS but getting an error message of REQUEST ERROR. I don't know what's went wrong. can someone please sort out my problem. Thanks in Advance

Before Hosting on IIS

enter image description here

the above picture is before hosting the service on IIS. and the yellow highlighted text is param and the JSON is the response which is corresponding to that param.

After Hosting on IIS

enter image description here

I don't know why I'm getting this error. what went wrong and how to fix that. now im trying to retrieving data correspond to that param but getting an error message.

"SERVER LOG after includeexceptiondetailInfaults attribute value to true"

I'ms sure that database is causing the error and you can view the picture of server log below

enter image description here


Solution

  • The database was causing an error. I have found the solution. what we need to do? We need to add a login to SQL Server for IIS APPPOOL\ASP.NET v4.0 and grant permissions to the database.

    In SQL Server Management, under the server, expand Security, then right click the Logins and select "New Login...".

    In the New Login dialog, enter the app pool as the login name and click "OK"

    enter image description here now right click the login, select properties and then click on the User Mapping Option. Click the appropriate DATABASE and check the properties roles. And we are done :).

    hope you good luck. Thanks