CSLA 4: WcfDataPortal Error

CSLA 4: WcfDataPortal Error

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


cjherasmus posted on Wednesday, June 15, 2011

Hi,

I have a Windows Forms app with a App.Config file:

 

<

 

 

add key="CslaDataPortalProxy" value="Csla.DataPortalClient.WcfProxy, Csla"/>

<add key="CslaDataPortalUrl" value ="http://localhost/xxx/WcfPortal.svc"/>

I have a ASP.NET website with a Web.Config file:

<

 

 

system.serviceModel>

<

 

 

services>

<

 

 

service name="Csla.Server.Hosts.WcfPortal" behaviorConfiguration="returnFaults">

<

 

 

endpoint binding="wsHttpBinding" bindingConfiguration="wsHttpBinding_IWcfPortal"

 

 

 

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

</

 

 

service>

</

 

 

services>

<

 

 

bindings>

<

 

 

wsHttpBinding>

<

 

 

binding name="wsHttpBinding_IWcfPortal" maxReceivedMessageSize="2147483647">

<

 

 

readerQuotas maxBytesPerRead="2147483647" maxArrayLength="2147483647"

 

 

 

maxStringContentLength="2147483647" maxNameTableCharCount="2147483647"

 

 

 

maxDepth="2147483647"/>

</

 

 

binding>

</

 

 

wsHttpBinding>

</

 

 

bindings>

<

 

 

behaviors>

<

 

 

serviceBehaviors>

<

 

 

behavior name="returnFaults">

<

 

 

serviceDebug includeExceptionDetailInFaults="true" />

</

 

 

behavior>

</

 

 

serviceBehaviors>

</

 

 

behaviors>

</

 

 

system.serviceModel>

The Windows app communicates with the WcfDataPortal on the webserver where I'm also going to host a website. The webserver communicates with SQL Server db. When I execute, I get a "Could not find element with name 'WcfDataPortal and contract..." error.

I then change the App.Config file to this:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<

 

 

appSettings>

<

 

 

add key="CslaDataPortalProxy" value="CSLA.DataPortalClient.WcfProxy, CSLA"/></

appSettings>

<

 

 

system.serviceModel>

<

 

 

client>

<

 

 

endpoint name="WcfDataPortal"

 

 

 

 

address=http://localhost/xxx/WcfPortal.svc

 

 

 

 

binding="wsHttpBinding" bindingConfiguration="wsHttpBindingSettings"

 

 

 

 

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

</

 

 

client>

<

 

 

bindings>

<

 

 

wsHttpBinding>

<

 

 

binding name="wsHttpBindingSettings" ></binding>

</

 

 

wsHttpBinding>

</

 

 

bindings>

</

 

 

system.serviceModel>

Now everything's working ok.

Why is this happening, because from the CSLA4 examples i understood that I could use the CslaDataPortalUrl, but for some reason I can't. Any thoughts please?

Copyright (c) Marimer LLC