Welcome to TechNet Blogs Sign in | Join | Help

A sample solution kit to demonstrate WPF & SQL Server Data Services Technologies-Part 1

The scenario of this solution kit is to store Workshop contents such as Workshop ID,Title and its pictures, docs & videos in SQL Server Data Services(SSDS) which is a Microsoft hosted Cloud Service, then pull the data from the cloud and view it via WPF.  As we know, WPF is perfect in displaying picture, .xps documents & playing videos with great user experiences.

The high-level architecture is as below:-

High-level architecture for the solution kit

Let's talk about the solution design from bottom to top that is  Infrastructure Services SSDS in this part. I created a separate WCF Service Application to access SSDS cloud service and expose workshop functional services.

sitka configuration

  • Then design the workshop entities. Remember there are 2 kinds of entities-Flexible Entity Type & Blob Entity Type. In our case, we'd better store Workshop List information such as WorkshopID, Title,Number of Picures,documents & videos for each workshop in Flexible Entities  while store Pictures ,Documents & Videos etc BLOB data into BLOB Entities, thus our Entities schema design can be interpreted with below diagram:-

Workshop Entity Schema

Note that the SSDS ACE Data Model is unlike Relational Database, 1 entity is just like 1 table record. In order to easily return all workshop entities just like "select * from workshoptable" in normal Relational Database design, I set same .Kind propertity value ("workshop" here) for all Workshop Entities. So with LINQ Query(remember SSDS use LINQ to query) "from e in entities where e.Kind==""workshop"" select e" , I can get all workshop entities.

  • I wrote 2 class modules to encapsulate Entity CRUD Operations, that is HandlingEnity.cs for Flexible Entity with SOAP API & HandlingBlob.cs for Blob Entity with REST API. The reason is only REST API is supported for Read/Write Blob Entity so far.
  • After that, I created a WCF Service which has exposed 2 Service Operations to query SSDS and return workshop data to Client. Note that you may need to specify <ProxyAddress> in your service configuration file if you access Internet from a proxy server. The related settings is similar as below:-

<binding name="SitkaSoapEndpoint" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="false" proxyAddress ="http://myproxy.com:80">
     ...

</binding>

Now we've finished Services Application part. In next session, I'll talk about Service Agent Application and WPF Client application.

You can download solution kit source code from here.

 

Published Saturday, August 30, 2008 10:44 AM by yanwang
Filed under: ,

Comments

No Comments

Anonymous comments are disabled
 
Page view tracker