My apologies if this is somewhere obvious; my meek searching of the forum did not reveal what I was hoping to find.
Are there documented steps on how to implement the beta CSLA WCF channel and data portals? I assume (!) that adding the WcfChannel project into the main CSLA solution and rebuilding gets me hooked up from a CSLA.dll perspective.
I was wondering if there was a Chapter 12-esque example of implementing the remote WCF data portal (creating an IIS virtual directory, creating a .svc file, proper set up of the config files on both the server and the client, etc.).
Thanks in advance -- JP
Unfortunately I haven't had time to document the channel...
You don't need to merge WcfChannel into CSLA at all - you can build it seperately into its own DLL, and then just reference that DLL from your UI project and WCF service project.
Then on the client, just change the data portal configuration to point to the WcfChannel assembly and proxy class. Also, in the client config you need to configure WCF itself.
On the server, as you note, create an svc file and configure WCF itself through web.config.
At some point in the next few weeks I do plan to write the Chapter 12-esque documentation for using the channel, but I've been waiting until WCF is final, and until I have time to then finalize both the C# and VB versions of the channel.
I also will merge it into CSLA itself - in CSLA .NET 2.2 (or 3.0?) - but that's a bigger task, because at that point I'll provide full support for WCF, including DataContract serialization.
To expand on that quickly though.
The UI project references the Csla.WcfChannel assembly and has a config file like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<appSettings>
<add key="CslaAuthentication" value="Csla" />
<add key="CslaDataPortalProxy"
value="Csla.DataPortalClient.WcfProxy, Csla.WcfChannel"/>
</appSettings>
<system.serviceModel>
<client>
<endpoint name="WcfDataPortal"
address="http://localhost:1107/WcfHost/WcfPortal.svc"
binding="wsHttpBinding"
contract="Csla.Server.Hosts.IWcfPortal" />
</client>
</system.serviceModel>
<system.diagnostics>
<sources>
<!-- This section defines the logging configuration for My.Application.Log -->
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<add name="FileLog"/>
<!-- Uncomment the below section to write to the Application Event Log -->
<!--<add name="EventLog"/>-->
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSwitch" value="Information" />
</switches>
<sharedListeners>
<add name="FileLog"
type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
initializeData="FileLogWriter"/>
<!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
<!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
</sharedListeners>
</system.diagnostics>
</configuration>
The Wcf server project is a virtual root in IIS and references the Csla.WcfChannel assembly (along with your business assembly typically - so the business assembly gets into the bin directory). The WcfChannel.svc file looks like this:
<%@ ServiceHost Service="Csla.Server.Hosts.WcfPortal" %>
The web.config file looks like this:
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
<add key="CslaAuthentication" value="Csla" />
</appSettings>
<connectionStrings>
<add name="PTracker"
connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Visual Studio Projects\csla20\ProjectTracker20cs\PTracker.mdf";Integrated Security=True;User Instance=True"
providerName="System.Data.SqlClient" />
<add name="Security"
connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Visual Studio Projects\csla20\ProjectTracker20cs\Security.mdf";Integrated Security=True;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.serviceModel>
<services>
<!-- Before deployment, you should remove the returnFaults behavior configuration to avoid disclosing information in exception messages -->
<service name="Csla.Server.Hosts.WcfPortal" behaviorConfiguration="returnFaults">
<endpoint contract="Csla.Server.Hosts.IWcfPortal" binding="wsHttpBinding"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="returnFaults">
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<system.web>
<compilation debug="true">
<assemblies>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies></compilation>
</system.web>
</configuration>
Everything you are saying makes sense to me.
The one thing I'd quibble with is the use of ES rather than WCF. Now that WCF is out, it is the replacement not only for Remoting and Web Services, but also for ES. If you are installing .NET 3.0, I'd go right ahead and use the WcfChannel for the extranet scenario.
Rocky --
I was sent this URL by a colleague. Upon reading it and seeing the date I have to ask if this thread is out of date or not?
It appears to be almost up to date except that the CslaDataPortalProxy assembly value is Csla.WcfChannel whereas in the CSLA 3.0 release it is just Csla.
In this thread you have: <add key="CslaDataPortalProxy" value="Csla.DataPortalClient.WcfProxy, Csla.WcfChannel"/>
whereas the released version has: <add key="CslaDataPortalProxy"
value="Csla.DataPortalClient.WcfProxy, Csla"/>
Or, maybe this is some additonal functionality that I am not aware of?
Best regards --
David Lutz
County of Marin
I released a beta WCF proxy for CSLA .NET 2.1, and that article
refers to that standalone proxy.
When I put the proxy actually into CSLA itself the assembly name
changed of course, because it is now in Csla.dll itself.
Rocky
From: dlutz52
[mailto:cslanet@lhotka.net]
Sent: Wednesday, February 06, 2008 4:06 PM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] Examples on setting up for WCF?
Rocky --
I was sent this URL by a colleague. Upon reading it and seeing the date I
have to ask if this thread is out of date or not?
It appears to be almost up to date except that the CslaDataPortalProxy
assembly value is Csla.WcfChannel whereas in the CSLA 3.0 release it is just Csla.
In this thread you have: <add
key="CslaDataPortalProxy" value="Csla.DataPortalClient.WcfProxy,
Csla.WcfChannel"/>
whereas the released version has: <add
key="CslaDataPortalProxy"
value="Csla.DataPortalClient.WcfProxy, Csla"/>
Or, maybe this is some additonal functionality that I am not aware of?
Best regards --
David Lutz
County of Marin
Copyright (c) Marimer LLC