New Posts New Posts RSS Feed: Configuring BOS for WCF
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Configuring BOS for WCF

 Post Reply Post Reply
Author
sebma View Drop Down
Groupie
Groupie
Avatar

Joined: 19-Aug-2008
Location: Singapore
Posts: 66
Post Options Post Options   Quote sebma Quote  Post ReplyReply Direct Link To This Post Topic: Configuring BOS for WCF
    Posted: 26-Aug-2008 at 3:27am
Hi All,
 
The Developers Guide mentions using <remoting> section in config files for configuring WCF.
 
Is there any ready samples from DevForce EF which I can use to run ServiceConsole.V4.exe configured to use WCF for communicationsTechnology section in <remoting> configuration?
 
Basically I want to test run few remote WCF clients getting domain objects from WCF server.
 
Thanks in advance.
Sebastian
 
Back to Top
davidklitzke View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 14-Jun-2007
Posts: 715
Post Options Post Options   Quote davidklitzke Quote  Post ReplyReply Direct Link To This Post Posted: 26-Aug-2008 at 9:27am

We only support WCF in v4, there’s no remoting.  So the samples in the zip below are all for WCF.  If you can wait a day, we will be releasing  our first non-Beta, non-RC version tonight.

uploads/23/IIS_Files.zip

Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 26-Aug-2008 at 11:50am
As David mentioned, out of the box both the ServerConsole and your client applications will use WCF, so long as you've turned on distributed processing:
 
    <objectServer isDistributed="true"
                  remoteBaseURL="http://localhost"
                  serviceName="EntityService"
                  serverPort="9009" />
We don't yet have any samples on customizing the WCF configuration (e.g., for security or message sizes) for either client or server, but both can be accomplished using the serviceModel section in the app.config. 
Back to Top
sebma View Drop Down
Groupie
Groupie
Avatar

Joined: 19-Aug-2008
Location: Singapore
Posts: 66
Post Options Post Options   Quote sebma Quote  Post ReplyReply Direct Link To This Post Posted: 26-Aug-2008 at 11:23pm
PART 1
Thanks David and Kim. I have yet to download the real non-RC version, but I got my remote client and ServiceConsole.V4.exe server working. My config settings are:
My embedded app.config on server-side contains:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <configSections>
        <section name="ideaBlade.v4" type="IdeaBlade.Util.Configuration.v4.IdeaBladeSection, IdeaBlade.Util.v4, Version=4.1.2.0, Culture=neutral, PublicKeyToken=287b5094865421c0" />
    </configSections>
    <ideaBlade.v4 version="4.00" useDTC="false" copyLocal="false"
        loginManagerRequired="false">
        <logging logFile="DebugLog.xml" archiveLogs="false" serviceName=""
            port="0" usesSeparateAppDomain="false" />
       
        <objectServer isDistributed="true" remoteBaseURL="http://development-01"
            serviceName="EntityService" serverPort="9009" />
       
        <edmKeys>
            <edmKey connection="metadata=res://......"
                containerName="DomainModel.MyEntities" logTraceString="false"
                name="Default" tag="">
                <probeAssemblyNames>
                    <probeAssemblyName name="MyDomainModel" />
                    <probeAssemblyName name="MyServerModel" />
                </probeAssemblyNames>
            </edmKey>
        </edmKeys>
        <notificationService enabled="false" serverPort="9011" clientPort="0" />
    </ideaBlade.v4>
</configuration>
 
My ServiceConsole.V4.exe.config contains:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <!-- =========== WCF hosting section ============== -->
  <system.serviceModel>
    <services>
      <service name="EntityService">
        <endpoint
          address="http://development-01:9009/EntityService"
          binding="customBinding" bindingConfiguration="compressedBinaryBinding"
          contract="IdeaBlade.EntityModel.v4.IEntityServiceContract" />
      </service>
      <service name="IdeaBlade.EntityModel.Server.v4.EntityServer">
        <endpoint
          address="http://development-01:9010/EntityServer"
          binding="customBinding" bindingConfiguration="compressedBinaryBinding"
          contract="IdeaBlade.EntityModel.v4.IEntityServerContract" />
      </service>
    </services>
    <bindings>
      <customBinding>
        <binding name="compressedBinaryBinding">
          <gzipMessageEncoding>
            <readerQuotas maxArrayLength="2147483647" maxDepth="2147483647"/>
          </gzipMessageEncoding>
          <httpTransport maxReceivedMessageSize="2147483647"/>
        </binding>
      </customBinding>
    </bindings>
    <!-- gzipMessageEncoding is a required extension.  Do not remove. -->
    <extensions>
      <bindingElementExtensions>
        <add name="gzipMessageEncoding" type="IdeaBlade.Util.Wcf.Extensions.v4.GZipMessageEncodingElement, IdeaBlade.Util.v4"/>
      </bindingElementExtensions>
    </extensions>
  </system.serviceModel>
</configuration>
Back to Top
sebma View Drop Down
Groupie
Groupie
Avatar

Joined: 19-Aug-2008
Location: Singapore
Posts: 66
Post Options Post Options   Quote sebma Quote  Post ReplyReply Direct Link To This Post Posted: 26-Aug-2008 at 11:34pm
PART 2
My embedded app.config on client-side remote executable contains:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <ideaBlade.v4 version="4.00">
    <logging logFile="DebugLog.xml" archiveLogs="false" />
    <objectServer isDistributed="true" remoteBaseURL="http://serverhostname"
    serviceName="EntityService" serverPort="9009" />
  </ideaBlade.v4>
</configuration>
 
My remoteclient.exe.config contains:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.serviceModel>
    <services>
      <service name="EntityService">
        <endpoint
          address="http://serverhostname:9009/EntityService"
          binding="customBinding" bindingConfiguration="compressedBinaryBinding"
          contract="IdeaBlade.EntityModel.v4.IEntityServiceContract" />
      </service>
      <service name="IdeaBlade.EntityModel.Server.v4.EntityServer">
        <endpoint
          address="http://serverhostname:9010/EntityServer"
          binding="customBinding" bindingConfiguration="compressedBinaryBinding"
          contract="IdeaBlade.EntityModel.v4.IEntityServerContract" />
      </service>
    </services>
    <bindings>
      <customBinding>
        <binding name="compressedBinaryBinding">
          <gzipMessageEncoding>
            <readerQuotas maxArrayLength="2147483647" maxDepth="2147483647"/>
          </gzipMessageEncoding>
          <httpTransport maxReceivedMessageSize="2147483647"/>
        </binding>
      </customBinding>
    </bindings>
    <!-- gzipMessageEncoding is a required extension.  Do not remove. -->
    <extensions>
      <bindingElementExtensions>
        <add name="gzipMessageEncoding" type="IdeaBlade.Util.Wcf.Extensions.v4.GZipMessageEncodingElement, IdeaBlade.Util.v4"/>
      </bindingElementExtensions>
    </extensions>
  </system.serviceModel>
</configuration>
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 27-Aug-2008 at 9:16am
Hi Sebastian,
 
You're doing more than necessary to configure both the client and server - you normally only need to use the serviceModel section (which is WCF) if you need to customize the configuration, or if you are hosting the BOS in IIS.  When you do need to customize settings with the serviceModel section, it's usually easiest to use one loose config file on each side with all configuration sections needed present, so that you know how communications were configured.  When you do use two config files, it's best to remove the <objectServer> element from the IdeaBlade.v4 section.
 
Here's what you can do, at the simplest, if you don't need to customize any of the DevForce defaults:
 
Server-side config - embedded or loose:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <configSections>
        <section name="ideaBlade.v4" type="IdeaBlade.Util.Configuration.v4.IdeaBladeSection, IdeaBlade.Util.v4, Version=4.1.2.0, Culture=neutral, PublicKeyToken=287b5094865421c0" />
    </configSections>
    <ideaBlade.v4 version="4.00" useDTC="false" copyLocal="false"
        loginManagerRequired="false">
        <logging logFile="DebugLog.xml" archiveLogs="false" serviceName=""
            port="0" usesSeparateAppDomain="false" />
       
  <!-- this configures the BOS with DevForce defaults -->
        <objectServer isDistributed="true" remoteBaseURL="http://development-01"
            serviceName="EntityService" serverPort="9009" />
       
        <edmKeys>
            <edmKey connection="metadata=res://......"
                containerName="DomainModel.MyEntities" logTraceString="false"
                name="Default" tag="">
                <probeAssemblyNames>
                    <probeAssemblyName name="MyDomainModel" />
                    <probeAssemblyName name="MyServerModel" />
                </probeAssemblyNames>
            </edmKey>
        </edmKeys>
    </ideaBlade.v4>
</configuration>
 
Client-side config - embedded or loose:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <configSections>
        <section name="ideaBlade.v4" type="IdeaBlade.Util.Configuration.v4.IdeaBladeSection, IdeaBlade.Util.v4, Version=4.1.2.0, Culture=neutral, PublicKeyToken=287b5094865421c0" />
    </configSections>
  <ideaBlade.v4 version="4.00">
    <logging logFile="DebugLog.xml" archiveLogs="false" />
 
    <!-- On the client, this configures the communications proxy to the BOS -->
    <objectServer isDistributed="true" remoteBaseURL="http://serverhostname"
    serviceName="EntityService" serverPort="9009" />
 
<!-- Include edmkeys if probing for any interface implementations,
      such as IIdGenerator
-->
 <edmKeys>
            <edmKey name="Default" >
                <probeAssemblyNames>
                    <probeAssemblyName name="MyDomainModel" />
                </probeAssemblyNames>
            </edmKey>
        </edmKeys>
  </ideaBlade.v4>
</configuration>
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 27-Aug-2008 at 9:25am
Part 2 - if you do want to customize communication settings
 
Your ServerConsole.v4.exe.config contents look fine.
 
Here's what a client-side serviceModel section should look like:
 
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.serviceModel>
    <client>
        <endpoint name="EntityService"
          address="
http://serverhostname:9009/EntityService"
          binding="customBinding" bindingConfiguration="compressedBinaryBinding"
          contract="IdeaBlade.EntityModel.v4.IEntityServiceContract" />
        <endpoint name="EntityServer"
          address="
http://serverhostname:9009/EntityServer"
          binding="customBinding" bindingConfiguration="compressedBinaryBinding"
          contract="IdeaBlade.EntityModel.v4.IEntityServerContract" />
    </client>
    <bindings>
      <customBinding>
        <binding name="compressedBinaryBinding">
          <gzipMessageEncoding>
            <readerQuotas maxArrayLength="2147483647" maxDepth="2147483647"/>
          </gzipMessageEncoding>
          <httpTransport maxReceivedMessageSize="2147483647"/>
        </binding>
      </customBinding>
    </bindings>
    <!-- gzipMessageEncoding is a required extension.  Do not remove. -->
    <extensions>
      <bindingElementExtensions>
        <add name="gzipMessageEncoding" type="IdeaBlade.Util.Wcf.Extensions.v4.GZipMessageEncodingElement, IdeaBlade.Util.v4"/>
      </bindingElementExtensions>
    </extensions>
  </system.serviceModel>
</configuration>


Edited by kimj - 27-Aug-2008 at 12:05pm
Back to Top
sebma View Drop Down
Groupie
Groupie
Avatar

Joined: 19-Aug-2008
Location: Singapore
Posts: 66
Post Options Post Options   Quote sebma Quote  Post ReplyReply Direct Link To This Post Posted: 27-Aug-2008 at 7:39pm

Many thanks Kim, your advice makes good sense.

I used the simplest DevForce defaults (non-customized) that you recommend for now and it works.
For the customized settings, I will try them out subsequently using the new non-RC version of DevForce EF ;-)
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 28-Aug-2008 at 8:30am
OK.  I'd suggest using the customized settings only if you understand WCF or must modify the defaults, since it can be very confusing to have configuration information scattered around.  
 
BTW, DevForce EF is available now. :)
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down