Why do I get denied access to WCF service?

Why do I get denied access to WCF service?

The times I have encountered it are when the wcf method is secured to a specific AD role: Setting the ClientCredentials on the web service client. This can be finicky and doing certain things to the client connection can cause you to lose the credentials.

What does access is denied mean in.net Framework 4.5?

I have a WCF service migrated to .Net framework 4.5 which is installed in IIS 7.0. I am able to browse the service in a browser. But when i refer the service in say a console application and try to call a method in it, i get the error “Access is denied”. Below is the stack trace and web.config settings i am using.

When do you call Web Service, Access Denied?

Exception Details: System.Net.WebException: The request failed with HTTP status 401: Access Denied. When Anonymous access authentication is turned off for the Web service application, all the caller applications must provide the credentials before making any request.

How to run a WCF service on SharePoint?

You have to make the app pool account running the WCF service either an Administrator on the SharePoint Server or make it a Farm Administrator. You also have to give this account rights on the Content Database as well as the SharePoint Config Database.

Is there an issue with WCF SOAP services?

There are known issues with the dynamic configuration of WCF SOAP services inside of SharePoint ( noted here ). If appropriate you may want to try configuring it as a WCF REST service instead. There is an blog post here where someone hit an issue with similar symptoms and what they did to resolve it. There are a few workarounds that I can think of.

How to consume a WCF service in SP?

First, To consume a WCF service running in SP, you always need to set the impersonation level in the consuming code: SPSecurity.RunWithElevatedPrivileges (delegate { using (SPSite newspSite = SPContext.Current.Site) { // your elevated actions (not actually elevated } }); // the current context is disposed!!

What to do when code is executed as a WCF service?

Option 1) Don’t use a WCF service, Use client OM to write a simple “flag” item to a list. Associate a workflow to the flag list which starts when new items are added. The workflow could start the timer job. Option 2) Code an ItemAdded event hander and do the conversion with the ConversionJob class.