New Posts New Posts RSS Feed: POCO N-tier Unable to locate public query method on server
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

POCO N-tier Unable to locate public query method on server

 Post Reply Post Reply
Author
-ook View Drop Down
Groupie
Groupie
Avatar

Joined: 26-Aug-2007
Location: Australia
Posts: 41
Post Options Post Options   Quote -ook Quote  Post ReplyReply Direct Link To This Post Topic: POCO N-tier Unable to locate public query method on server
    Posted: 10-Dec-2012 at 3:35pm
Hello
 
I have followed the instructions regarding POCO implementation in IdeaBlade and have downloaded and reviewed the PocoApp code sample. Having reviewed all of this I have created my own simple project based on the DevForce n-tier WPF Application template and added some POCO classes and ServiceProvider.
 
However whenever I wish to query the poco class I always recieve the error: "Unable to locate public query method on server ".
 
Upon reviewing the error logs I find that:
  1. The Service finds the query in question "Probed for service provider query methods and found GetFilterOperators"
  2. When calling the query, suddenly it cannot be found: "Caught exception: System.Exception: Unable to locate public query method on server for: 'GetFilterOperators' at "
So the server service finds the query method when it is loading up, but then has a sudden attack of amnesia when a client attempts to call it.
 
The GetFilterOperator is a simple implementation:
 

[EnableClientAccess]
    public class PocoServiceProvider
    {
        public PocoServiceProvider() { }

        [Query]
        public IEnumerable<FilterOperator> GetFilterOperators()
        {
            _filterOperators = FilterOperator.CreateInstances();
            return _filterOperators;
        }

        private static List<FilterOperator> _filterOperators = null;

}And is called in the client application by:

 var query = new EntityQuery<FilterOperator>("GetFilterOperators", _mgr);
      _mgr.ExecuteQueryAsync<FilterOperator>(query, FilterOperatorLoaded, null);
The Server Log is below.... any ideas why the Ideablade server cannot find this POCO query?

 

2012-12-1110:19:37IdeaBlade.EntityModel.KnownTypeHelper:<GetMarkedKnownTypes>b__13Probed for known types and found TestNTierModel.FilterOperator
2012-12-1110:19:37IdeaBlade.EntityModel.KnownTypeHelper:<GetMarkedKnownTypes>b__13Probed for known types and found TestNTierModel.EventFrame
2012-12-1110:19:37IdeaBlade.EntityModel.KnownTypeHelper:<GetMarkedKnownTypes>b__13Probed for known types and found TestNTierModel.FurnaceProductionEvent
2012-12-1110:19:37IdeaBlade.EntityModel.KnownTypeHelper:<GetMarkedKnownTypes>b__13Probed for known types and found TestNTierModel.FilterHelper
2012-12-1110:19:37IdeaBlade.Core.Composition.CompositionHost:CheckMultiExportCompositionContext: '-IbDefault-' - Probed for non-default 'IKnownTypeProvider' and found no matching exports.
2012-12-1110:19:37IdeaBlade.EntityModel.RemoteServiceFns:AddSerializationBehaviorUsing DC serializer for EntityServer
2012-12-1110:19:37IdeaBlade.EntityModel.Server.EntityServerHostFactory:CreateServiceHostEntityServer listening on http://localhost:9009/EntityServer.svc
2012-12-1110:19:37IdeaBlade.EntityModel.Server.EntityServerHostFactory:CreateServiceHostEntityServer listening on http://localhost:9009/EntityServer.svc/sl
2012-12-1110:19:38IdeaBlade.EntityModel.EntityMetadataStore:LoadMetadataFromEmbeddedResourcesNo metadata resources found in 'TestNTierWeb, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
2012-12-1110:19:38Guest - 1IdeaBlade.EntityModel.Edm.UdtMethodMap:<BuildUdtMethodMaps>b__eProbed for service provider query methods and found GetFilterOperators
2012-12-1110:19:38Guest - 1IdeaBlade.EntityModel.Edm.UdtMethodMap:<BuildUdtMethodMaps>b__eProbed for service provider query methods and found GetFurnaceProductionEvents
2012-12-1110:19:38Guest - 1IdeaBlade.Core.Composition.CompositionHost:CheckSingleExportCompositionContext: '-IbDefault-' - Probed for any 'EntityServerErrorInterceptor' and found 'IdeaBlade.EntityModel.Server.EntityServerErrorInterceptor'.
2012-12-1110:19:38Guest - 1IdeaBlade.EntityModel.Server.EntityServerErrorInterceptor:OnErrorCaught exception: System.Exception: Unable to locate public query method on server for: 'GetFilterOperators' at IdeaBlade.EntityModel.Edm.UdtTransformVisitor.GetUdtQueryable(String entitySetName, Type returnEntityType, List`1 parameters) at IdeaBlade.EntityModel.Edm.UdtTransformVisitor.VisitConstant(ConstantExpression ce) at IdeaBlade.Linq.ExpressionVisitor.VisitExpressionCore(Expression e) at IdeaBlade.Linq.TransformExpressionVisitor.VisitExpressionCore(Expression expr) at IdeaBlade.Linq.ExpressionVisitor.VisitExpression(Expression expr) at IdeaBlade.Linq.ExpressionVisitor.Visit(Expression expr) at IdeaBlade.EntityModel.Edm.UdtTransformVisitor.Transform(EntityQuery query) at IdeaBlade.EntityModel.Server.EntityServer.Fetch(SessionBundle sessionBundle, IEntityQuerySurrogate surrogate) at SyncInvokeFetch(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
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: 10-Dec-2012 at 4:32pm
This particular case of amnesia would be due to a bug.
 
DevForce is stripping off the prefix portion of the method name, in this case "Get", and then expecting the client application to use the remaining portion of the method name, in this case "FilterOperators", in the entity set name argument of the EntityQuery.
 
You have two options:
 
1) You can add a QueryAttribute with PreserveName = true to your query method to tell DevForce not to strip off the prefix.  You can then continue using the "GetFilterOperators" name on the client.
 
2) Or you can keep your query method as is, and change your client query like so:
   query = new EntityQuery<FilterOperator>("FilterOperators", _mgr);
Back to Top
-ook View Drop Down
Groupie
Groupie
Avatar

Joined: 26-Aug-2007
Location: Australia
Posts: 41
Post Options Post Options   Quote -ook Quote  Post ReplyReply Direct Link To This Post Posted: 10-Dec-2012 at 5:30pm
I see,  I have removed the 'Get' from the client call and it works well now.
 
Thankyou ver much.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down