Trying to get the WCF portal to work

Trying to get the WCF portal to work

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


danielrail posted on Thursday, September 04, 2008

Hi,

I'm trying to get the WCF data portal to work with CSLA.Net 3.5 and .Net 3.5 SP1.  I get the connection working, but I get an error a little time after the request for Fetch is sent. 

On the client I get the following error message:

 "The underlying secure session has faulted before the reliable session fully completed. The reliable session was faulted."

I'm trying to retrieve approximately 50,000 records from the database.  And, this is my first experience with WCF.  Any hints or ideas, would be appreciated.

Here's the WCF service web.config System.ServiceModel section:

<system.serviceModel>

<client>

<endpoint name="WcfDataPortal"

address="http://localhost:3564/WcfHost/WcfPortal.svc"

binding="wsHttpBinding"

contract="Csla.Server.Hosts.IWcfPortal" />

</client>

<bindings>

<wsHttpBinding>

<binding name="UserNameWS" receiveTimeout="00:20:00" sendTimeout="00:20:00">

<reliableSession enabled="true" ordered="true" inactivityTimeout="00:20:00"/>

<security mode="Message">

<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />

<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true" />

</security>

</binding>

</wsHttpBinding>

</bindings>

<behaviors>

<serviceBehaviors>

<behavior name="WcfPortalBehavior">

<serviceMetadata httpGetEnabled="true" />

<serviceDebug includeExceptionDetailInFaults="true" />

</behavior>

</serviceBehaviors>

</behaviors>

<services>

<service behaviorConfiguration="WcfPortalBehavior" name="Csla.Server.Hosts.WcfPortal">

<endpoint address="" binding="wsHttpBinding" bindingConfiguration="UserNameWS"

contract="Csla.Server.Hosts.IWcfPortal">

<identity>

<dns value="localhost" />

</identity>

</endpoint>

<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />

</service>

</services>

</system.serviceModel>

 

Here's the System.ServiceModel in the Winforms client application:

<system.serviceModel>

<bindings>

<wsHttpBinding>

<binding name="WSHttpBinding_IWcfPortal" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:20:00" sendTimeout="00:20:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">

<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />

<reliableSession ordered="true" inactivityTimeout="00:20:00" enabled="true" />

<security mode="Message">

<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />

<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true" />

</security>

</binding>

</wsHttpBinding>

</bindings>

<client>

<endpoint address="http://localhost:9162/ClaimsWCFWebSite/WcfPortal.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IWcfPortal" contract="Csla.Server.Hosts.IWcfPortal" name="WcfDataPortal">

<identity>

<dns value="localhost" />

</identity>

</endpoint>

</client>

</system.serviceModel>

 

Daniel

Paul Czywczynski replied on Thursday, September 04, 2008

I am guessing you're hitting a WCF quota limit somewhere with that many records. I do see you're setting readerquotas on the client side but not the server side. I always make sure my bindings are identical on both sides. If you're still having problems after you fix your server side config, enable WCF tracing and you'll probably see a more detailed exception.

-Paul

Paul Czywczynski replied on Thursday, September 04, 2008

Here is an example of my client/server bindings. Please don't copy/paste, it won't work for you, but you get the idea of what values are needed to pass large resultsets.

         <binding name="fxCompressedBinaryBinding" closeTimeout="00:30:00" openTimeout="00:30:00" receiveTimeout="00:30:00" sendTimeout="00:30:00">
          <gzipMessageEncoding innerMessageEncoding="binaryMessageEncoding">
            <readerQuotas maxDepth="2147483647"
                          maxStringContentLength="2147483647"
                          maxArrayLength="2147483647"
                          maxBytesPerRead="2147483647"
                          maxNameTableCharCount="2147483647" />
          </gzipMessageEncoding>
          <httpTransport keepAliveEnabled="true"
                         maxReceivedMessageSize="2147483647"
                         authenticationScheme="Ntlm" />
        </binding>

danielrail replied on Monday, September 08, 2008

Thanks.  It was a size setting that I needed to change.  As I already stated, this is my first WCF project, and it's only my second with CSLA.  And, I know that I still have a lot to learn with regards to WCF(books are on order) and CSLA(already have Rocky's books).

Again, thanks for the reply.

Daniel Rail

Copyright (c) Marimer LLC