WCF and Sharepoint

WCF and Sharepoint

Old forum URL: forums.lhotka.net/forums/t/6613.aspx


danielw posted on Tuesday, March 17, 2009

I am trying to get CSLA running under sharepoint.

But am having trouble getting it to work.
I have followed the below example

http://blah.winsmarts.com/2008-5-SharePoint_2007_as_a_WCF_host_-_Step_-1,_make_a_WCF_Home.aspx

and have managed to get it working for a test example. But can not get it working for csla.

Has anybody had any experience of this?

 

Cheers

Daniel

 

Craig.Young replied on Wednesday, September 09, 2009

I got the service to work actually just a few moments ago. Meaning I got the wsdl to show up in a browser. The trick was to GAC the server version of CSLA.


So far to get to this point I have to GAC:
CSLA Assembly (server version)
WCF Service Assembly (which also contains the code for WCFSupport in Sharepoint).
Business Objects Assembly.
Business ObjectFactory Assembly

However upon invocation, I receive an error that says DataPortal.Fetch<BusinessObject>() failed because the type Business.DataAccess.BusinessObjectFactory, Business.DataAccess cannot be found.

This is odd because I have Business.DataAccess GAC'd as well. My BusinessObjectFactory is tagged with Csla.Server.ObjectFactoryAttributes. Something is crazy with reflection here and loading the named assembly. I even fully qualified the assembly to load with the Version=, Culture=, and the correct PublicKeyToken.

Help?

Craig.Young replied on Thursday, September 10, 2009

Actually I figured this out as well. WSPBuilder to the rescue!
After a day of toying with my solution I now only need to GAC one assembly and the rest I figured out I needed to place in the 80/bin folder of my Sharepoint Solution project.

The really difficult part for me at least was figuring out how to get Sharepoint Context. But that's solved now thanks to AspNetCompatibilityMode being set to Required on my WCF service.

Copyright (c) Marimer LLC