November Happy Hour will be moved to Thursday December 5th.

Using DDS outside of EPiServer

Vote:
 

I would like to know if it is possible to use DDS from another non EPiServer website.

I would like to move some web services from an existing episerver website into another website which has its own application pool.

 

As far as im aware, there are a couple of ways of doing this.

1. Use the DDS API's from the EPiServer dll's in the separate services website.

2. Insert data into DDS by calling directly the stored procedures created in the database for each user data store (i.e Save_MyDataStore).

 

I think there could be a couple of issues with these two methods:

1. Using the DDS API's - I don't know whether I will need an EPiServer licence in the website to run this.

2. Using the stored procedures - is this safe? The only concern I have is with the caching EPiServer does. I guess caching will be ok as long as the DDS cache on the website uses an SQL dependency.

 

Has anyone implemented something like this before or can comment on the above?

 

Thanks.

Adam

#72599
Jun 24, 2013 11:26
Vote:
 

Hi Adam!

Last time I checked there where no check for license in EPiServer.Data.dll (or dependent assemblies) so it should work to run them in a separate instance but you will never get any guaranties the they will not add license checks in the future.

If you update the database directly you will run into problem because DDS does not use a SQL Dependencies.

You will probably need to add EPiServer.Data, EPiServer.Framework, EPiServer.Data.Cache and EPiServer.Events to you service, sprinkle with some configuration (connectionStrings, WCF for EPiServer Events, etc).

At least for the first version of the DDS, Paul Smith published s Unit Test project that run separatly. It can be downloaded here.

Please let us know the results of your tests!

#72615
Jun 24, 2013 16:13
Vote:
 

Thanks Fredrik - I'll have a look and let you know how we get on.

#72637
Jun 25, 2013 11:54
Vote:
 
#72662
Edited, Jun 25, 2013 20:17
Vote:
 

Thanks Valdis - I am working with Joel on this (who has commented on your blog post).

I think we are running into structure map issues as we are using EPiServer 7 (so the episerver 7 dlls for data etc).

Have you been able to get this working against an EPiServer 7 instance of DDS?

Thanks,

Adam

#72742
Jun 27, 2013 12:19
Vote:
 

Great. This was used in CMS6. I'll check what's the case in v7. StructureMap needs to be initialized beforehand using any base classes as most of the interfaces are retrieved via ServiceLocator.

#72747
Jun 27, 2013 13:12
Vote:
 

Try this code:

var container = new Container();
var factory = new SqlDatabaseFactory();
container.Configure(ce => ce.For<IDatabaseHandler>().Use(factory.CreateDefaultHandler));
ServiceLocator.SetLocator(new StructureMapServiceLocator(container));

// if you need caching - replace `null'
DataInitialization.InitializeFromCode(container, factory, null);
var store = typeof(SampleModel).GetStore();

    

 

NB! <episerver.dataStore> element for v7 is optional. If you still add it - be sure to clear providers list before adding - otherwise you will get "Key has already been added" type of exception.

#72758
Jun 27, 2013 16:04
Vote:
 

Hi Valdis,

Well that certainly seems to be doing the trick! Now we are successfully writing to DDS outside of an EPiServer website.

I wondered why I was getting those key already added errors and didn't realise that the <episerver.datastore> section was optional in v7.

Thanks very much for your help. It all looks so simple when you know what you are doing!

 

 

#72759
Edited, Jun 27, 2013 18:06
Vote:
 

Can you get data from the DDS using an internal webservice?

I seem to be getting zero items back but using the same code on a normal page I get results.

Jon

#113450
Nov 20, 2014 18:18
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.