Author |
Share Topic Topic Search Topic Options
|
rasmus
Groupie
Joined: 05-Aug-2009
Location: Denmark
Posts: 63
|
Post Options
Quote Reply
Topic: Multiple databases from Silverlight Posted: 03-Jul-2013 at 5:34pm |
Hi
Is this possible using a silvelight client?
http://drc.ideablade.com/xwiki/bin/view/Documentation/create-entitymanager-datasource-extension
When I add datasourceExtension to my login, Instead of the EM using another connection on the server, it tries connect to another EntityService_XXX. Is this by design?
I have also implemented a IDataSourceKeyResolver on the server, but no matter what I do, no keyExtension is passed to the implementation.
Hope you can help
Best regards,
Rasmus
|
|
kimj
IdeaBlade
Joined: 09-May-2007
Posts: 1391
|
Post Options
Quote Reply
Posted: 04-Jul-2013 at 7:34am |
Data source extensions work the same with a Silverlight client as they do in other types of applications. Each extension results in a different EntityServer service URL, so you will see a URL like EntityServer_AA.svc for an "AA" extension. This extension is used to form the EdmKey/DbKey name used to resolve the connection string.
The extension should be passed as a parameter into the GetKey method in your IDataSourceKeyResolver. What are you seeing?
|
|
rasmus
Groupie
Joined: 05-Aug-2009
Location: Denmark
Posts: 63
|
Post Options
Quote Reply
Posted: 04-Jul-2013 at 8:05am |
Hi
Thank you for your reply
This parameter passed to the IDataSourceKeyResolver is blank no matter what i pass in as parameter from the client.
Best regards,
Rasmus
|
|
kimj
IdeaBlade
Joined: 09-May-2007
Posts: 1391
|
Post Options
Quote Reply
Posted: 05-Jul-2013 at 10:20am |
The data source extension needs to be passed into the EntityManager constructor. If you're providing it only as a LoginOption to the Authenticator then this isn't sufficient for the EM to use the extension when querying and saving.
|
|
rasmus
Groupie
Joined: 05-Aug-2009
Location: Denmark
Posts: 63
|
Post Options
Quote Reply
Posted: 05-Jul-2013 at 11:00am |
Hi
I have tried passing to the constructor. Can you confirm this to be working. I am running version 7.1.2 (Silverlight)
Best regards,
Rasmus
|
|
kimj
IdeaBlade
Joined: 09-May-2007
Posts: 1391
|
Post Options
Quote Reply
Posted: 05-Jul-2013 at 11:29am |
Yes, I can confirm this works in 7.1.2.
Are you registering the DevForce ServiceVirtualPathProvider in your global.asa application start logic? Have you implemented a custom ServiceProxyEvents or ServiceHostEvents? DevForce will use a separate EntityServer service for each data source extension, and gets that extension from the URL. If you're doing anything to modify the URL then that might be the problem.
DevForce can also be somewhat picky about the characters in the extension: "+", "-" and "_" characters can cause problems.
|
|
rasmus
Groupie
Joined: 05-Aug-2009
Location: Denmark
Posts: 63
|
Post Options
Quote Reply
Posted: 05-Jul-2013 at 12:58pm |
Hi
I do not use the ServiceVirtualPathProvider. I have “real” EntityServer.svc and EntityService.svc files, and for the extension (which is “Demonstration”) I have EntityServer_Demonstration.svc and EntityService_Demonstration.svc. I can confirm that the *.svc files are used by the client, just no parameters are transferred.
So if I understand you correctly, does this mean that the fact that I do not use ServiceVirtualPathProvider means that I am not able to transfer the parameters?
Can you show me a way to set up the ServiceVirtualPathProvider to be used instead of my physical EntityServer.svc and EntityService.svc files?
I would like if I could keep the URL for the services, and not have the "/sl" extension added.
Best regards,
Rasmus
|
|
kimj
IdeaBlade
Joined: 09-May-2007
Posts: 1391
|
Post Options
Quote Reply
Posted: 05-Jul-2013 at 1:56pm |
Your EntityServer_Demonstration.svc should contain the following:
<%@ServiceHost language=”C#”
Service="IdeaBlade.EntityModel.Server.EntityServer, Demonstration"
Factory="IdeaBlade.EntityModel.Server.EntityServerHostFactory"
%>
You don't need an EntityService_Demonstration.svc.
There's more information on how to pass parameters to the service in the samples.
|
|
rasmus
Groupie
Joined: 05-Aug-2009
Location: Denmark
Posts: 63
|
Post Options
Quote Reply
Posted: 05-Jul-2013 at 2:30pm |
Hi
That did the trick :-)
Thanks,
Rasmus
|
|