New Posts New Posts RSS Feed: EntityServiceApplication & OnServiceStartup
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

EntityServiceApplication & OnServiceStartup

 Post Reply Post Reply
Author
antalakas View Drop Down
Newbie
Newbie
Avatar

Joined: 25-Jun-2007
Location: Greece
Posts: 28
Post Options Post Options   Quote antalakas Quote  Post ReplyReply Direct Link To This Post Topic: EntityServiceApplication & OnServiceStartup
    Posted: 30-Sep-2009 at 2:14am
Hello,

I create a silverlight application using the devfore template. Nothing unusual.

Then i create a new assembly, namely Server.dll and add a reference to it in the web project. An entry in web.config <probeAssemblyName name="Server" /> is also added.

I add a method in Server.dll tagged with the [IdeaBlade.EntityModel.AllowRpcAttribute].

Then, from the client i use InvokeServerMethodAsync to access this method and everything works great.

At last, i create a new class, MyServiceApplication :


using System;
using System.Linq;

using IdeaBlade.EntityModel;
using IdeaBlade.Core;

namespace Server
{
    public class MyServiceApplication : IdeaBlade.EntityModel.EntityServiceApplication
    {
        public override void OnServiceStartup(object sender, ServiceStartupEventArgs e)
        {
            TraceFns.WriteLine("MyServiceApplication - OnServiceStartup");
            base.OnServiceStartup(sender, e);
        }

        public override void OnServiceShutdown(object sender, EventArgs e)
        {
            TraceFns.WriteLine("MyServiceApplication - OnServiceShutdown");
            base.OnServiceShutdown(sender, e);
        }
    }
}

I expect, when the Entity Service is created, to call OnServiceStartup and write an entry in DebugLog.xml. In DebugLog.xml i receive:

IdeaBlade.EntityModel EntityServiceApplication::OnServiceStartup EntityService created ,

which means that no override took place.

Do i miss something?

Thank you

Andreas
Andreas Ntalakas
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: 30-Sep-2009 at 9:36am

DevForce uses somewhat different means of looking for the methods marked with the AllowRpcAttribute vs. an implementation of a custom EntityServiceApplication.

Methods marked with AllowRpc aren't actually probed - the type and method information provided in the InvokeServerMethod call is used to search for the method.  The assembly is loaded if necessary, but it's assumed to already be in the bin folder.  If you add the assembly name to the <probeAssemblyNames> somewhere in the config this will usually just mean that the assembly has already been loaded (usually when probing for other reasons) before the type and method are reflected.
 
Probing is used when looking for a custom EntityServiceApplication.  Here only the top-level (as opposed to EdmKey-level) <probeAssemblyNames> are searched.  So your implementation should be found if you add (or move) that <probeAssemblyName> element to the top-level.  (You can use the Configuration Editor if you need help with the elements/attributes defined in the ideablade.configuration section.)
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down