Posts Tagged Sharepoint 2010

SharePoint 2010 – Gripes, Groans and Gremlins


Introduction

I’ve been trying to get ADOMD, or AMO, to work from a BDC in SharePoint 2010. I’ve been building the BCD in Visual Studio, which has been working quite well. The problem I ran into was getting an exception when trying to open the connect to Analysis Services on another server.

Gremlins

The exception  I was getting was:

A first chance exception of type 
'Microsoft.AnalysisServices.AdomdClient.AdomdConnectionException' occurred in
Microsoft.AnalysisServices.AdomdClient.dll Microsoft.AnalysisServices.AdomdClient.AdomdConnectionException:
The connection either timed out or was lost. --->
System.IO.IOException: Unable to read data from the transport connection:
An existing connection was forcibly closed by the remote host. --->
System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) --- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.IO.BufferedStream.Read(Byte[] array, Int32 offset, Int32 count) at Microsoft.AnalysisServices.AdomdClient.DimeRecord.ForceRead(Stream stream, Byte[] buffer, Int32 length) at Microsoft.AnalysisServices.AdomdClient.DimeRecord.ReadHeader() at Microsoft.AnalysisServices.AdomdClient.DimeReader.ReadRecord() at Microsoft.AnalysisServices.AdomdClient.TcpStream.GetResponseDataType() --- End of inner exception stack trace --- at Microsoft.AnalysisServices.AdomdClient.XmlaClient.EndRequest() at Microsoft.AnalysisServices.AdomdClient.XmlaClient.CreateSession(
ListDictionary properties, Boolean sendNamespaceCompatibility) at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.XmlaClientProvider.
Microsoft.AnalysisServices.AdomdClient.AdomdConnection.IXmlaClientProviderEx.CreateSession(
Boolean sendNamespaceCompatibility) at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.ConnectToXMLA(Boolean createSession, Boolean isHTTP) at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.Open() at AnalysisServicesCubesBDCModel.BdcModel1.SharePointCubeDetails.PopulateListOfCubes()

Which seems to suggest that the client is getting kicked off the server. Or, my connection was being rejected by the Analysis Services Server. This diagnosis proved to be incorrect!

It turned out that SharePoint was also shutting down the connection. NB: Both ADOMD and AMO are probably using the Analysis Services Web Service “under the covers” to get the information.

How to get SharePoint to let the Analysis Services Web Services Call happen?

Solution and Gripe!

Once the “penny dropped” that it was SharePoint “stopping” the connection, a bit of browsing the SharePoint class libraries yielded the following solution.

public static IEnumerable<Cars> ReadList()
 {
 //TODO: This is just a sample. Replace this simple sample with valid code.
 IEnumerable<Cars> carsList = null;
 Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(delegate()
 {
 carsList = Cars.GetList();
 });

 return carsList;
 }
Gripe: I don’t like embedding a “wholesale” privilege elevation in a system. 

I’ll have to look more deeply into SharePoint application security to see if there is a more finer grained way of controlling the security context of an application.

GROAN !

As part of the implementation of the linkage between Analysis Services and SharePoint, I had in mind pass into SharePoint some URL’s. So in the BDC designer in Visual Studio 2010, I tried to use the URI type.

The following is a screen garb of the types which the BDC “supports”:clip_image002

You can “scratch” Uri. I created a property on the Object being passed back of type Uri. The added that property into the BDC definition. When the BDC was mapped into SharePoint as an External List, the property did not appear (no error, just plain missing in action).

Technorati Tags: ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

Windows Live Tags: SharePoint 2010,Gripes,Groans,Gremlins,ADOMD,Visual Studio,exception,Analysis Services,server,Microsoft,AnalysisServices,AdomdClient,AdomdConnectionException,connection,System,IOException,Unable,data,Sockets,SocketException,NetworkStream,Read,Byte,size,BufferedStream,DimeRecord,ForceRead,Stream,length,ReadHeader,DimeReader,ReadRecord,TcpStream,GetResponseDataType,XmlaClient,EndRequest,CreateSession,ListDictionary,properties,Boolean,AdomdConnection,XmlaClientProvider,IXmlaClientProviderEx,ConnectToXMLA,Open,AnalysisServicesCubesBDCModel,SharePointCubeDetails,PopulateListOfCubes,client,diagnosis,Service,information,Call,Solution,Gripe,libraries,IEnumerable,Cars,ReadList,RunWithElevatedPrivileges,GetList,elevation,context,GROAN,Object,definition,External List,csharpcode

Digg This

Advertisements

Leave a comment

Talking about Using the SharePoint Business Data Connectivity Designer in VS 2010 | Visual Studio Team Interviews


Introduction

At work  I’m starting to build a BI Portal in SharePoint 2010.

Getting SharePoint 2010 installed has proved to be a bit of a trial. The main source of “aggravation” was in the installation of SQL Server 2008 R2. That was probably cause by a limited “admin” ID in the work production domain. I’ve not tried to explore what’s missing, but I suspect that there will be some privileges which are  missing.

I’ve yet to install PowerPivot, and see how that works with SharePoint 2010. That installation another “adventure” I’ve in store for later this week(probably next week).

One of the elements I need for this “BI Portal” is a (SharePoint) list of the Analysis Services Cubes which are going to be part of the Portal. That’s a “long” list, and best surfaced as a dynamic link into the Analysis Services Metadata (AdomdConnection.GetSchemaDataSet will list Analysis Services – Databases [Catalogs in ADOMD speak] and Cube).

To do this one needs to used a “Business Data Connectivity” (BDC) object (.NET Code which “pokes” external data into SharePoint).

The following links to the Channel 9 MSDN are highly recommended. The first video is all I needed to get up and developing a BDC (I’ll soon find out what’s missing). The second is a good series of tips about deployment and debugging BDC’s.

Quote

Using the SharePoint Business Data Connectivity Designer in VS 2010 | Visual Studio Team Interviews

Tips & Tricks with Business Data Connectivity Model Deployment in Visual Studio 2010

Technorati Tags: ,,,,,,,,,,,,,,,,,,,,

Windows Live Tags: SharePoint 2010,Visual Studio,BI Portal,installation,SQL Server 2008 R2,PowerPivot,Analysis Services,Cubes,Metadata,AdomdConnection,GetSchemaDataSet,Databases,Catalogs,ADOMD,Cube,Channel 9,MSDN,deployment,Tips,Tricks,Model

Digg This

, , ,

Leave a comment

%d bloggers like this: