How to config the new MobileProxy host in a console App or a service App?

How to config the new MobileProxy host in a console App or a service App?

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


kmgbkj posted on Thursday, February 13, 2014

Hi Rocky,

     I have read the discussion about "Data transfer speed issues for WindowsForms/WPF in 4.5.20" and check the example in source code, learned how to config MobileProxy in Web,but i have several app hosted in a service process,i want to change WCFProxy  to MobileProxy that increase the speed. but i can't get the right way.

My old config for wcf is this:

<?xml version="1.0"?>

<configuration>

  <appSettings>

    <add key="CslaAuthentication" value="Csla"/>

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

  </appSettings>  

  <system.serviceModel>

    <services>

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

        <endpoint address="http://127.0.0.1:8000/" contract="Csla.Server.Hosts.IWcfPortal" binding="customBinding" bindingConfiguration="compactBinding"/>

        <endpoint address="net.tcp://192.168.1.4:5898/" contract="Csla.Server.Hosts.IWcfPortal" binding="netTcpBinding" bindingConfiguration="compactBindingForTCP2"/>

      </service>

 

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

        <endpoint address="net.tcp://192.168.1.4:5899/" contract="Csla.Server.Hosts.Mobile.IWcfPortal" binding="netTcpBinding" bindingConfiguration="compactBindingForTCP2" />          

      </service>

    </services>

    <bindings>

      <customBinding>

        <binding name="compactBinding" sendTimeout="00:10:00">

          <compactMessageEncoding>

            <binaryMessageEncoding>

              <readerQuotas maxDepth="64" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>

            </binaryMessageEncoding>

          </compactMessageEncoding>

          <httpTransport maxReceivedMessageSize="2147483647"/>

        </binding>

        <binding name="compactBindingForTCP" portSharingEnabled="true" maxReceivedMessageSize="2147483647">

          <compactMessageEncoding>

            <binaryMessageEncoding>

              <readerQuotas maxDepth="64" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>

            </binaryMessageEncoding>

          </compactMessageEncoding>

          <tcpTransport>

            <connectionPoolSettings groupName="default" idleTimeout="00:05:00" leaseTimeout="00:05:00" maxOutboundConnectionsPerEndpoint="10"/>

          </tcpTransport>

        </binding>

      </customBinding>

      <netTcpBinding>

        <binding name="compactBindingForTCP2" closeTimeout="00:01:00"

            openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"

            transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"

            hostNameComparisonMode="StrongWildcard" listenBacklog="10"

            maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="100"

            maxReceivedMessageSize="2147483647">

          <readerQuotas maxDepth="64" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>

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

        </binding>

      </netTcpBinding>

      <basicHttpBinding>

        <binding name="basicHttpBinding_IWcfPortal" maxReceivedMessageSize="2147483647">

          <readerQuotas maxBytesPerRead="2147483647" maxArrayLength="2147483647" maxStringContentLength="2147483647" maxDepth="1024" />

        </binding>

      </basicHttpBinding>

    </bindings>

    <extensions>

      <bindingElementExtensions>

        <add name="compactMessageEncoding" type="Amib.WCF.CompactMessageEncodingElement, CompactMessageEncoder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>

      </bindingElementExtensions>

    </extensions>

    <behaviors>

      <serviceBehaviors>

        <behavior name="returnFaults">

          <serviceDebug includeExceptionDetailInFaults="false"/>

          <serviceMetadata httpGetEnabled="false"/>

        </behavior>

        <behavior name="">

          <serviceMetadata httpGetEnabled="true" />

          <serviceDebug includeExceptionDetailInFaults="false" />

        </behavior>

        <behavior name="WcfPortalBehavior">

          <serviceMetadata httpGetEnabled="true" />

          <serviceDebug includeExceptionDetailInFaults="true" />

        </behavior>

      </serviceBehaviors>

    </behaviors>

  </system.serviceModel>

<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>

</configuration>

Can i use the same config for MobileProxy? or the MobileProxy can only in use for WebHost?

JonnyBee replied on Sunday, February 16, 2014

Hi,

You can use the MobileProxy in all client types starting with Csla 4.5.x. Have a look at this previous post: 

http://forums.lhotka.net/forums/t/11905.aspx

Copyright (c) Marimer LLC