Friday, June 24, 2011

How to Impersonate SharePoint Client Object Model

Using this you can pass dedicated credentials to SharePoint client object.

using System.Net;
using Microsoft.SharePoint.Client;

ClientContext context = new ClientContext("http://server/");
context.Credentials = new NetworkCredential("user", "password", "domain");
// Some Cording
context.ExecuteQuery(); 

Thursday, June 23, 2011

DataAdapterException, Exception Message: The remote server returned an error: (500) Internal Server Error. Server was unable to process request. ---> Attempted to perform an unauthorized operation. The remote server returned an error: (500) Internal Server Error.)

 

I got this error when i open the InfoPath Form using Form server. This form location is different to the original location (actual scenario is earlier this form was in the root site collection and now in the sub site collection) .

This form access the user profile web service (Userprofileservice.asmx) using   UDC file. When i check the UDC connection i figured out it is still pointing to root site. so you have to change this file to match with the sub site collection. otherwise there may be a cross domain access issue.

Untitled

Wednesday, June 22, 2011

MetaInformationByUrl:CrossSite check failed for site URL= …. and file URL=: … .xsn

 

This error you can find in the SharePoint LOG with relevant to Correlation ID.

image  

.This error is happened to me when i tried to content deployment to a Production server.

In the SharePoint Server side following errors may come due to this error.

  • The form you are attempting to open may be located on a different server. This form can only be opened using Microsoft InfoPath.
  • The form has been closed.
  • The InfoPath form template for the selected content type cannot be loaded.

These errors can be solved using changing the following settings. this error generates because Form Server XSN refers separate form server template in a  separate server.

image 

To change this Go to SharePoint designer and navigate to content types and click administration page.

image

then go to advanced settings. In here it will show the Form Template URL. Check It is relevant URL if not change it.

image

Monday, June 20, 2011

Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'

in External Data Types Creating Using  Business Data Connectivity Services

this error coming because of , External System not getting proper identity to connect. thus if you change the Business Data Connection Authentication mechanism to BDC Identity it will work.

image

But sometimes  you might get following error message when you going to change the Authentication method to BDC Identity.

 image

To Overcome this message you need to run following Power Shell Scripts in Administrator Mode.

First you need to get the list of running services.

PS > $apps = Get-SPServiceApplication

Then you need to get the correct item from this collection. In here you can use pipe ( | ) operation or you can simply increase the element Id and look what is the element  is. $apps[0] , $apps[1] … In my case it is 15. but this may differ.

image

then you need to update the RevertToSelfAllowed to true. Following commands will do it.

PS C:\Users\shpdevadmn> $apps[15].RevertToSelfAllowed = $true

PS C:\Users\shpdevadmn> $apps[15].Update()

Friday, June 17, 2011

_catalogs/masterpage/Forms/Page Layout. There is already an object with the Id 853c8232-ae6d-4626-9cae-682xxxxxx

 

Error in SharePoint 2010 content deployment  

If you deployed to a new web application this error will not come.

if we we delete existing site collection in the web application till these files are  existing in the content database. thus if you remove and re create the web application this error will not come in the SharePoint content deployment.