RSS
 

Archive for the ‘ASP.Net & AJAX’ Category

Error 403 Forbidden SharePoint WSS Problem

01 Sep

This is a common scenario… it works on my machine but on another environment the application just refuses to work…

Well, I had a tough problem to solve lately. I was using WSS Application Pages and whenever I visit my application page, it gave me an error 404. I could even debug the code on the machine but it completes without an error and afterwards it just turned out to be a 404 in the browser.

The other pages were working fine… only this one was failing. I almost gave up on this but then I remembered it was the only page using AJAX.

The AjaxControlToolkit.dll wasn’t in the GAC. I really don’t understand why this isn’t logged anywhere. EventViewer? SharePoint Logs? Failure on debug? Nothing.

Anyways, make sure you have all your dlls in your bin folder or GAC.

 

RoleService not working

05 Feb

The WCF Authentication Service is great to use and it works perfectly… however, I had a lot of problems trying to get the roleservice working.

WCF Role Service is not returning any results. Anything is well configured as described on MSDN: How to: Enable the WCF Authentication Service.

I could call the role service without a problem but there weren’t any queries launched at the database.
After a long search on the internet and msdn, I finally found a small MSDN Note that says the following.

Do not call the GetRolesForCurrentUser method from code that is executing on the Web server. You call the GetRolesForCurrentUser method only as part of a WCF service. For more information about how to read a user’s roles in code that is executing on the Web server, see the GetRolesForUser method.

Why I’m using the roleservice from my ASP.Net application is hard to explain… it’s related to the fact that silverlight, sharepoint login form and custom asp.net websites are using the same webservice. We want to limit the configuration of the Membership and have our forms based user object at WCF level.

So when you’re calling this service from a client application (Silverlight), it will work. If you’re calling this from a server application like ASP.Net, you just don’t get any results back… You should use the Membership classes on your custom WCF Service in order to write your own role methods.