Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with MM.NET and WCF
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01314349
Message ID:
01315878
Views:
41
Hi Kevin,

I get the error on all the business objects.

This is what I have in my sample application factory class.


WCF works if you override dataaccess on each individual business object

'''
''' Factory method that creates a data access object
'''

''' Reference to the data access object
Protected Overrides Function CreateDataAccessObject(ByVal dataAccessClassName As String) As mmDataAccessBase
'Return New OSPPeriodLineDataAccess()
Dim binding As New WSHttpBinding()
binding.MaxReceivedMessageSize = 147483647
Dim address As New EndpointAddress("http://ykhanlt.acelosolutions.com/OSPService/Service.svc/mex")
Return New mmDataAccessWCFSql(binding, address)
End Function
    Public Class Factory
    Inherits OakLeaf.MM.Main.Windows.Forms.mmFactoryDesktop
    Public Overrides Function CreateDataAccessSql() As mmDataAccessSql
        If mmAppBase.DefaultDataAccessMode = mmDataAccessMode.Local Then
            Return MyBase.CreateDataAccessSql()
        Else
            Dim binding As New WSHttpBinding()
            binding.MaxReceivedMessageSize = 147483647
            Dim address As New EndpointAddress("http://ykhanlt/OSPService/Service.svc/mex")
            Return New mmDataAccessWCFSql(binding, address)
        End If
    End Function

End Class
This is the config file for the sample application
 <?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="databaseSets" type="System.Configuration.NameValueSectionHandler, 
         System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <section name="databases" type="System.Configuration.NameValueSectionHandler, 
         System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
  </configSections>
  <connectionStrings>
    <add name="OakLeaf.MM.NorthwindSample.Main.Business.Properties.Settings.NorthwindConnectionString" connectionString="Data Source=madi;Initial Catalog=Northwind;User ID=sa" providerName="System.Data.SqlClient" />
  </connectionStrings>
  <appSettings>
    <!--   User application and configured property settings go here.-->
    <!--   Example: <add key="settingName" value="settingValue"/> -->
    <add key="SecurityDatabaseSetKey" value="CustA" />
    <add key="SecurityDatabaseKey" value="Northwind" />
    <add key="DatabaseSetDefault" value="CustA" />
    <add key="DisplayToolTips" value="true" />
    <!-- Event Log, Trace Log and Transaction Log settings:
		1. The EventLog Level setting (options are "Error", "Warning", "Info", and "Verbose"
		2. The name of the machine on which the event log resides, default is "." (local machine)
		3. The name of the log
		-->
    <add key="EventLog\Level" value="Verbose" />
    <add key="EventLog\Machine" value="." />
    <add key="EventLog\Name" value="Application" />
    <add key="TraceLog\Machine" value="." />
    <add key="TraceLog\Name" value="Application" />
    <add key="TransactionLog\Machine" value="." />
    <add key="TransactionLog\Name" value="Application" />
    <!-- Specifies the primary key of the default application language
	   (for localization purposes). Only used when LocalizeApp="true"
	    -->
    <add key="DefaultLanguage" value="1" />
    <!-- Specifies the database key for application messages
		This key doesn't need to be specified if there is only one
		database in your application specified in the <databases> element.
		Only used when LocalizeApp="true"
		-->
    <add key="MessageDatabaseKey" value="Northwind" />
    <!-- Specifies the default data acccess model: "local", "wcf" or "webservice" -->
    <add key="DefaultDataAccessMode" value="wcf" />
    <!-- Specifies if security is enabled -->
    <add key="SecurityEnabled" value="false" />
    <!-- If set to false, indicates the application is not localized,
		and uses hard-coded strings for displaying messages and
		for user interface text. If true, specifies the application uses
		mmMessageMgr to data-drive application text.		-->
    <add key="LocalizeApp" value="false" />
    <!-- Specifies if the database script was run to add sprocs to Northwind -->
    <add key="DatabaseScriptRun" value="True" />
  </appSettings>
  <databaseSets>
    <add key="CustA" value="Customer A (SQL Server)" />
    <add key="CustB" value="Customer B (Visual FoxPro)" />
  </databaseSets>
  <databases>
    <add key="CustA\Northwind\Connection" value="server=madi;uid=sa;pwd=nixon37;database=Northwind;" />
    <add key="CustA\Northwind\DataAccessClass" value="DataAccessSql" />
    <add key="CustB\Northwind\Connection" value="Provider=vfpoledb.1;Data Source=C:\Program Files\Mere Mortals .NET Framework 2008\Samples\VFPData\northwind.dbc" />
    <add key="CustB\Northwind\DataAccessClass" value="DataAccessOleDb" />
  </databases>
  <system.windows.forms jitDebugging="true" />
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="EnvDTE" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>
Thanks
Yassin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform