Pages

Tuesday, October 23, 2012

SharePoint 2010 Search Refinement Panel web part



In SharePoint 2007 - I have used "faceted search" from codeplex http://facetedsearch.codeplex.com/ to grouping search results by different category name, total number of values inside group, etc... BUT SharePoint 2010 provides OOB web part called "search refinement panel" in which we can achieve more or less same type of results and output like faceted search.

For achieving grouping functionalities in SharePoint 2010 search refinement panel web part - we can create managed property from central admin and can customize XML for search refinement web part to display search results by different categories.

Result type, site, author and modified date categories are by default in search refinement panel web part.

Here are some reference links for customizing refinement panel web part in SharePoint 2010:




Friday, October 19, 2012

Error "Unexpected System.NullReferenceException" after restoring a content database



For one of the specific project reason, we have to restore content database to SharePoint 2010 environment. after we restored the database, suddenly I started receiving "Unexpected System.NullReferenceException" error while opening SharePoint site. we checked every configuration settings from central admin and database side and every was correct. still we didn't able to find the solution.

It seems error is because of caching issue between some of the web front end servers.

Here is link which is explaining about root cause and solution of the error: http://myspworld.wordpress.com/2012/02/06/unexpected-system-nullreferenceexception/

Happy Debugging !!

SharePoint 2010 Search Demo

The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'NTLM'



I was getting above error while accessing User Profile web service, after searching online I have found to resolution in which first I need to disabled Anonymous access on web service level and needs to make security changes into app.config file. after this changes my code was working fine.

search.asmx web service : Server was unable to process request. ---> Attempted to perform an unauthorized operation



I was getting "Server was unable to process request. ---> Attempted to perform an unauthorized operation" error while accessing SharePoint 2010 OOTB search web service from C# windows application. I have very simple code which is calling search web service and returning data in grid format. I have refer this MSDN link for sample code: http://msdn.microsoft.com/en-us/library/ff394650.aspx 

I have searched a lot in Google and also spent good amount of time but didn't get success from any of the sites and didn’t find any resolution.

Finally I have found very interesting root cause for my problem and resolved the issue by myself :)

Here is the actual issue: When we are adding ‘service reference’ from visual studio tool, system is removing actual full site name from the site address URL and keeping just the top level site name into app.config file for service end point address.

e.g. I have added http://sptoplevelsite.com/sites/subsitename/_vti_bin/search.asmx as service reference from Visual Studio, but app.config file has http://sptoplevelsite.com/_vti_bin/search.asmx as service end point address instead of exact full site URL.

So in my case, most of the user doesn’t have access to top level SharePoint URL because of which I was getting "Server was unable to process request. ---> Attempted to perform an unauthorized operation." Error.

Solution:
1) I have just added user to the top level site http://sptoplevelsite.com and same code started working without making any changes into code or server level configuration.
2) I need to find a way to change or pass end point address from C# code itself which will overwrite app.config file settings.

Sometime small things matter :)

Enjoy!!!!