disconnected agent help please

Topics: CAB & Smart Client Software Factory, Offline Application Block
Jun 16, 2007 at 6:42 AM
Edited Jun 16, 2007 at 6:44 AM
So I have created a disconnected service agent using the SCSF recipe. The dsa connects to a web service.

In my smart client, I initialize the Request manager with the following:

RequestManager requestManager = DatabaseRequestManagerIntializer.Initialize();
requestManager.StartAutomaticDispatch();
RootWorkItem.Services.Add(requestManager.RequestQueue);

The queue is configured as follows:

<dataConfiguration defaultDatabase="QueueDatabase">
<providerMappings>
<add databaseType="Microsoft.Practices.SmartClient.EnterpriseLibrary.SmartClientDatabase, Microsoft.Practices.SmartClient.EnterpriseLibrary"
name="System.Data.SqlServerCe" />
</providerMappings>
</dataConfiguration>

<connectionStrings>
<add name="QueueDatabase" connectionString="DataSource=Datastore.sdf" providerName="System.Data.SqlServerCe" />
</connectionStrings>

When my app calls proxies on the DSA, the requests are getting enqueued. I use the following:

IRequestQueue rq = RequestManager.Instance.RequestQueue;
MyNS.Agent agent = new MyNS..Agent(rq); // the DSA
agent.MyServiceProxy(1);
int x = rq.GetCount(); // x does increase

And finally, in CallBack.cs produced by the DSA recipe, I implement the callback routines for MyServiceProxy

public override void OnMyServiceProxyReturn(Request request, object[] parameters, object returnValue)
{
Dosomething(returnValue);
}

public override OnExceptionAction OnMyServiceProxyException(Request request, Exception ex)
{
throw new NotImplementedException("Not implemented", ex);
}

and it seems that these are never called.

It seems that I am missing a step here as I can see that the queue has the requests in it, and the request manager is supposed to automatically dispatch, but my callbacks are never getting called (my breakpoints never get hit) and the number of requests in the queue just gets bigger. What crucial step am I missing?
It seemed like this should work according to the documentation.

Thanks for any help!
Sep 11, 2007 at 6:35 AM
Have you dispatched the request ?
Pass the configured request to the Enqueue method of the DatabaseRequestQueue(Custom request queue) like
- reqManager.RequestQueue.Enqueue(req);
Then the dispatcher sends the request to the remote service when a connection to the network specified for the request's endpoint is available

If you have done this already, then verify the configuration files for proper Address, binding and contracts


Feb 26, 2008 at 2:24 PM
I had the same issue, I simply had to remove the endpoint string in the Agent.cs...

public static string Endpoint
{
get
{
return "";
}
}

Then it worked, Hope this helps.
Jun 24, 2009 at 4:52 AM

Winger,

 

What did you put in place of the empty string for the Endpoint?  I notice that my Request objects all have blank string for an Endpoint as well.

 

-Trey