<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Jeff's thoughts on Software Architecture, Large Scale Services and the Technical world at large : SQL Server Data Services</title><link>http://blogs.msdn.com/jcurrier/archive/tags/SQL+Server+Data+Services/default.aspx</link><description>Tags: SQL Server Data Services</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>SDS Channel 9 Video is up</title><link>http://blogs.msdn.com/jcurrier/archive/2008/10/27/sds-channel-9-video-is-up.aspx</link><pubDate>Tue, 28 Oct 2008 06:27:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9019635</guid><dc:creator>jcurrier</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jcurrier/comments/9019635.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jcurrier/commentrss.aspx?PostID=9019635</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jcurrier/rsscomments.aspx?PostID=9019635</wfw:comment><description>&lt;P&gt;A little while ago Jason and I recorded a Channel 9 video to discuss some of the newer features in SDS (SQL Data Services).&amp;nbsp; Now that all the Azure components have been announced this is now available up at the Channel 9 site.&amp;nbsp; You can view it &lt;A href="http://channel9.msdn.com/posts/dunnry/Whats-new-in-SQL-Data-Services-for-Developers/" mce_href="http://channel9.msdn.com/posts/dunnry/Whats-new-in-SQL-Data-Services-for-Developers/"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9019635" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jcurrier/archive/tags/Services/default.aspx">Services</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SQL+Server+Data+Services/default.aspx">SQL Server Data Services</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SQL+Data+Services/default.aspx">SQL Data Services</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SDS/default.aspx">SDS</category></item><item><title>Channel 9 interview for PDC</title><link>http://blogs.msdn.com/jcurrier/archive/2008/10/23/channel-9-interview-for-pdc.aspx</link><pubDate>Thu, 23 Oct 2008 20:39:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9013386</guid><dc:creator>jcurrier</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/jcurrier/comments/9013386.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jcurrier/commentrss.aspx?PostID=9013386</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jcurrier/rsscomments.aspx?PostID=9013386</wfw:comment><description>&lt;p&gt;&lt;a href="http://blogs.msdn.com/hunter-gatherer/"&gt;Jason&lt;/a&gt; and I just finished recording a session on some of the new features of the services that will be announced at PDC next week (along with some others such as Blobs).&amp;#160; Keep in eye out for it.&amp;#160; I think you'll enjoy it!&lt;/p&gt;  &lt;p&gt;--Jeff--&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9013386" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SSDS/default.aspx">SSDS</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SQL+Server+Data+Services/default.aspx">SQL Server Data Services</category></item><item><title>What happened to SSDS PUT/POST responses?</title><link>http://blogs.msdn.com/jcurrier/archive/2008/07/25/what-happened-to-ssds-put-post-responses.aspx</link><pubDate>Fri, 25 Jul 2008 20:06:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8772512</guid><dc:creator>jcurrier</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jcurrier/comments/8772512.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jcurrier/commentrss.aspx?PostID=8772512</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jcurrier/rsscomments.aspx?PostID=8772512</wfw:comment><description>&lt;p&gt;Since the rollout I've seen at least one or two messages regarding the altered responses we're now sending with the REST head of the service.&amp;#160; There are several reasons why we've changed the service to now not return the entity body back to you again.&amp;#160; These are as follows:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;strong&gt;Version&lt;/strong&gt; - Prior to this rollout the only mechanism that we had to communicate version information to you was via the entity body of the response (specifically the version element in the body).&amp;#160; However, now that we have true ETag support we now can simply return this value back to caller via the ETag header per the Http spec.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Cost&lt;/strong&gt; - Although at this point we don't charge for the service we eventually will.&amp;#160; Included within this billing structure are charges for ingress &amp;amp; egress (bandwidth usage in essence).&amp;#160; Therefore, by not returning the body to the caller (which the caller originally provided us with anyway) this is a net cost savings for you the caller.&amp;#160; &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Hope this helps to explain a bit more of the thinking behind the change.&amp;#160; As always we're open to feedback.&lt;/p&gt;  &lt;p&gt;--Jeff--&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8772512" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SSDS/default.aspx">SSDS</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SQL+Server+Data+Services/default.aspx">SQL Server Data Services</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/ETag/default.aspx">ETag</category></item><item><title>Check out the SSDS coverage in the latest issue of MSDN magazine.</title><link>http://blogs.msdn.com/jcurrier/archive/2008/07/03/check-out-the-ssds-coverage-in-the-latest-issue-of-msdn-magazine.aspx</link><pubDate>Thu, 03 Jul 2008 22:28:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8685280</guid><dc:creator>jcurrier</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jcurrier/comments/8685280.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jcurrier/commentrss.aspx?PostID=8685280</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jcurrier/rsscomments.aspx?PostID=8685280</wfw:comment><description>&lt;p&gt;Hey all, &lt;/p&gt; &lt;p&gt;If you have a subscription to MSDN magazine, heck even if you don't, you read a bit more about using SSDS in the latest issue.&amp;nbsp; If you don't have a subscription then you can still read the article on-line &lt;a href="http://msdn.microsoft.com/en-us/magazine/cc700349.aspx"&gt;here&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Enjoy!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8685280" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SSDS/default.aspx">SSDS</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SQL+Server+Data+Services/default.aspx">SQL Server Data Services</category></item><item><title>Optimistic Concurrency with SOAP in SSDS</title><link>http://blogs.msdn.com/jcurrier/archive/2008/06/29/optimistic-concurrency-with-soap-in-ssds.aspx</link><pubDate>Sun, 29 Jun 2008 23:47:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8668458</guid><dc:creator>jcurrier</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/jcurrier/comments/8668458.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jcurrier/commentrss.aspx?PostID=8668458</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jcurrier/rsscomments.aspx?PostID=8668458</wfw:comment><description>&lt;P&gt;In my last &lt;A href="http://blogs.msdn.com/jcurrier/archive/2008/06/22/etag-s-optimistic-concurrency-and-ssds.aspx" mce_href="http://blogs.msdn.com/jcurrier/archive/2008/06/22/etag-s-optimistic-concurrency-and-ssds.aspx"&gt;post&lt;/A&gt; I described how ETag's can be used in the upcoming sprint 3 version of SSDS.&amp;nbsp; In this post I'd like to talk about how this same functionality is exposed through our SOAP service head.&lt;/P&gt;
&lt;P&gt;In many ways designing this particular feature for the REST head was much easier than for the SOAP service head.&amp;nbsp; This is because the Http specification describes, in a fair bit of detail, what the semantics are around things like ETag's.&amp;nbsp; The SOAP specification provides no such guidance and as a result we've rolled our own implementation here to support this feature in a way that makes sense for our service.&amp;nbsp; &lt;/P&gt;
&lt;H4&gt;&lt;STRONG&gt;VersionMatch&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;As I mentioned earlier, since there is no ETag concept natively in SOAP we've introduced a new object called, "VersionMatch".&amp;nbsp; We've augmented the Scope struct in the system to now include this so that version is now also considered a qualifier for operations that take place via the SOAP service head.&lt;/P&gt;
&lt;P&gt;The VersionMatch object, as shown in the class diagram below, captures two things.&amp;nbsp; The first, is the version of the entity in question.&amp;nbsp; This could be the version of the entity we've just created, the version that I, as a caller, want to retrieve, or finally the one I want to update or delete.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The second concept is something we refer to as the, "MatchType" or VersionMatchType.&amp;nbsp; This is used to determine how the service should compare the version when executing the requested operation.&amp;nbsp; This could mean that we only perform the operation if the version matches the version in the store (the VersionMatchType.Match case), or only perform the operation if it doesn't match (the VersionMatchType.NotMatch case) or finally to ignore the version completely when performing the operation.&amp;nbsp; NOTE: By default we use the Ignore semantic unless otherwise instructed.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Class Diagram of the modified Scope object along with the new VersionMatch object and VersionMatchType enum.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/OptimisticConcurrencywithSOAPinSSDS_B357/image_4.png" mce_href="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/OptimisticConcurrencywithSOAPinSSDS_B357/image_4.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=311 alt=image src="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/OptimisticConcurrencywithSOAPinSSDS_B357/image_thumb_1.png" width=538 border=0 mce_src="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/OptimisticConcurrencywithSOAPinSSDS_B357/image_thumb_1.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, that we've covered a bit of the changes to how we address things in the system let's see how we can apply these new features to some common scenarios.&lt;/P&gt;
&lt;H4&gt;&lt;STRONG&gt;Conditional Get&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;Conditional retrieval is an interesting case if a mid-tier or client application is maintaining a cache.&amp;nbsp; This shows up many times in the web browser case where large files are cached until they've been either refreshed or updated on the service side.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;We can now perform a similar operation now using the SOAP service head.&amp;nbsp; I've created a sample below which illustrates how a caller can now conditionally retrieve an entity only if the version has changed.&lt;/P&gt;&lt;PRE&gt;            &lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt; (SitkaSoapServiceClient client = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; SitkaSoapServiceClient("&lt;SPAN style="COLOR: #8b0000"&gt;SitkaSoapEndpoint&lt;/SPAN&gt;"))
            {
                &lt;SPAN style="COLOR: #0000ff"&gt;try&lt;/SPAN&gt;
                {
                    &lt;SPAN style="COLOR: #008000"&gt;// Create a reference to some entity that we know exists and one that&lt;/SPAN&gt;
                    &lt;SPAN style="COLOR: #008000"&gt;// we have a reference to in our cache (the version we have is 2000).&lt;/SPAN&gt;
                    Scope entityScope = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; Scope();
                    entityScope.AuthorityId = "&lt;SPAN style="COLOR: #8b0000"&gt;some_authority&lt;/SPAN&gt;";
                    entityScope.ContainerId = "&lt;SPAN style="COLOR: #8b0000"&gt;some_container&lt;/SPAN&gt;";
                    entityScope.EntityId = "&lt;SPAN style="COLOR: #8b0000"&gt;123&lt;/SPAN&gt;";
                    entityScope.VersionMatch = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; VersionMatch();
                    entityScope.VersionMatch.Version = 2000;
                    entityScope.VersionMatch.MatchType = VersionMatchType.NotMatch;

                    &lt;SPAN style="COLOR: #008000"&gt;// Then, retrieve the entity *only* if the version doesn't match the&lt;/SPAN&gt;
                    &lt;SPAN style="COLOR: #008000"&gt;// one that I already know about.&lt;/SPAN&gt;
                    Entity theEntity = client.Get(entityScope);

                }
                &lt;SPAN style="COLOR: #0000ff"&gt;catch&lt;/SPAN&gt; (FaultException&amp;lt;Error&amp;gt; ex)
                {
                    &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (ex.Detail.StatusCode == ErrorCodes.EntityNotModified)
                    {
                        &lt;SPAN style="COLOR: #008000"&gt;// there is no later version.&lt;/SPAN&gt;
                    }
                }
            }&lt;/PRE&gt;
&lt;H4&gt;&lt;STRONG&gt;Conditional Update and Delete&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;The next two cases are really very similar to one another.&amp;nbsp; In both of these cases we really only want to update (or delete) the entity if we know that there has been no other modifications to the entity in question.&amp;nbsp; This way we can be certain that we've not overwritten someone else's changes (in the update case) or perhaps deleted an entity which now (since the update) may not have needed to be deleted.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The code listing below illustrates both of these cases.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Conditional Update in SOAP&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;            &lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt;(SitkaSoapServiceClient client = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; SitkaSoapServiceClient("&lt;SPAN style="COLOR: #8b0000"&gt;SitkaSoapEndpoint&lt;/SPAN&gt;"))
            {
                &lt;SPAN style="COLOR: #0000ff"&gt;try&lt;/SPAN&gt;
                {
                    &lt;SPAN style="COLOR: #008000"&gt;// Create a reference to some entity that we know exists.&lt;/SPAN&gt;
                    Scope entityScope = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; Scope();
                    entityScope.AuthorityId = "&lt;SPAN style="COLOR: #8b0000"&gt;some_authority&lt;/SPAN&gt;";
                    entityScope.ContainerId = "&lt;SPAN style="COLOR: #8b0000"&gt;some_container&lt;/SPAN&gt;";
                    entityScope.EntityId = "&lt;SPAN style="COLOR: #8b0000"&gt;123&lt;/SPAN&gt;";

                    &lt;SPAN style="COLOR: #008000"&gt;// Then, retrieve the entity (any version will do).&lt;/SPAN&gt;
                    Entity theEntity = client.Get(entityScope);

                    &lt;SPAN style="COLOR: #008000"&gt;// Update some properties on the Entity.&lt;/SPAN&gt;
                    theEntity.Properties["&lt;SPAN style="COLOR: #8b0000"&gt;FavoriteStorageService&lt;/SPAN&gt;"] = "&lt;SPAN style="COLOR: #8b0000"&gt;SSDS&lt;/SPAN&gt;";

                    &lt;SPAN style="COLOR: #008000"&gt;// Next, update the version match properties on the scope we'll be using to update&lt;/SPAN&gt;
                    &lt;SPAN style="COLOR: #008000"&gt;// the entity with.&lt;/SPAN&gt;
                    entityScope.VersionMatch = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; VersionMatch();
                    entityScope.VersionMatch.Version = theEntity.Version;
                    entityScope.VersionMatch.MatchType = VersionMatchType.Match;

                    &lt;SPAN style="COLOR: #008000"&gt;// Finally, update the entity if the version check clears.&lt;/SPAN&gt;
                    client.Update(entityScope, theEntity);

                }&lt;SPAN style="COLOR: #0000ff"&gt;catch&lt;/SPAN&gt;(FaultException&amp;lt;Error&amp;gt; ex)
                {
                    &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(ex.Detail.StatusCode == ErrorCodes.PreconditionFailed)
                    {
                        &lt;SPAN style="COLOR: #008000"&gt;// Our version check failed so we don't have the latest and greatest.&lt;/SPAN&gt;
                    }
                }
            }&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;Conditional Delete in SOAP&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;            &lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt;(SitkaSoapServiceClient client = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; SitkaSoapServiceClient("&lt;SPAN style="COLOR: #8b0000"&gt;SitkaSoapEndpoint&lt;/SPAN&gt;"))
            {
                &lt;SPAN style="COLOR: #0000ff"&gt;try&lt;/SPAN&gt;
                {
                    &lt;SPAN style="COLOR: #008000"&gt;// Create a reference to some entity that we know exists.&lt;/SPAN&gt;
                    Scope entityScope = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; Scope();
                    entityScope.AuthorityId = "&lt;SPAN style="COLOR: #8b0000"&gt;some_authority&lt;/SPAN&gt;";
                    entityScope.ContainerId = "&lt;SPAN style="COLOR: #8b0000"&gt;some_container&lt;/SPAN&gt;";
                    entityScope.EntityId = "&lt;SPAN style="COLOR: #8b0000"&gt;123&lt;/SPAN&gt;";

                    &lt;SPAN style="COLOR: #008000"&gt;// Next, set the version match properties on the scope we'll be using to remove&lt;/SPAN&gt;
                    &lt;SPAN style="COLOR: #008000"&gt;// the entity with.&lt;/SPAN&gt;
                    entityScope.VersionMatch = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; VersionMatch();
                    entityScope.VersionMatch.Version = 2000; &lt;SPAN style="COLOR: #008000"&gt;// the version of the entity we know about.&lt;/SPAN&gt;
                    entityScope.VersionMatch.MatchType = VersionMatchType.Match;

                    &lt;SPAN style="COLOR: #008000"&gt;// Finally, remove the entity if the version check clears.&lt;/SPAN&gt;
                    client.Delete(entityScope);

                }&lt;SPAN style="COLOR: #0000ff"&gt;catch&lt;/SPAN&gt;(FaultException&amp;lt;Error&amp;gt; ex)
                {
                    &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(ex.Detail.StatusCode == ErrorCodes.PreconditionFailed)
                    {
                        &lt;SPAN style="COLOR: #008000"&gt;// Our version check failed so we don't have the latest and greatest.&lt;/SPAN&gt;
                    }
                }
            }&lt;/PRE&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;That covers the optimistic concurrency examples for the Sprint 3 bits of SSDS.&amp;nbsp; I'm certain that there are other scenarios here that I'm not covering and I'd really like to hear other scenarios if you have them to share.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Next time, I'll cover perhaps the biggest feature of the sprint (and one of our most requested features of the service that we have now completed for sprint 3....).&amp;nbsp; Look for more shortly :-)&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8668458" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SSDS/default.aspx">SSDS</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SQL+Server+Data+Services/default.aspx">SQL Server Data Services</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/ETag/default.aspx">ETag</category></item><item><title>ETag's, Optimistic Concurrency and SSDS</title><link>http://blogs.msdn.com/jcurrier/archive/2008/06/22/etag-s-optimistic-concurrency-and-ssds.aspx</link><pubDate>Sun, 22 Jun 2008 10:17:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8637098</guid><dc:creator>jcurrier</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/jcurrier/comments/8637098.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jcurrier/commentrss.aspx?PostID=8637098</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jcurrier/rsscomments.aspx?PostID=8637098</wfw:comment><description>&lt;p&gt;I've been kind of quiet the last month or so but that's because I've been totally heads down implementing some major features for this sprint in SSDS.&amp;#160; Our next release to production, which should be in the next few weeks,&amp;#160; is coming up fast so I thought over the next few posts to the blog I would cover some of the highlights of the release. &lt;/p&gt;  &lt;p&gt;We've covered a lot of ground in this sprint.&amp;#160; We've added some features, which I believe, that people will be pretty excited about.&amp;#160; I've decided to start the ball rolling with one of the features that was requested early on of the service... ETag support.&amp;#160; &lt;/p&gt;  &lt;h4&gt;ETag's in SSDS&lt;/h4&gt;  &lt;p&gt;It may be useful to quickly review the role that &lt;a href="http://en.wikipedia.org/wiki/HTTP_ETag"&gt;ETag's&lt;/a&gt; play in a RESTful service.&amp;#160; The ETag header value is typically used by a client application to determine if the content of a give resource has changed over some period of time.&amp;#160; In SSDS we use the value of the, &amp;quot;Version&amp;quot; property as the ETag header value for a given entity.&amp;#160; As documented &lt;a href="http://msdn.microsoft.com/en-us/library/cc512402.aspx"&gt;previously&lt;/a&gt;, the version value will be changed when a update takes place to a entity.&amp;#160; &lt;/p&gt;  &lt;p&gt;At this point, you may be asking yourself when do I get one of these things back to me?&amp;#160; Beginning with the next rollout ETag's will be returned to the caller on all POST, PUT, and single entity GET operations.&amp;#160; Now, with query operations we can't return back a ETag value simply because the response doesn't actually refer to any one particular entity in the service.&amp;#160; Instead, if you would like to determine what would be the ETag value for any one entity in the EntitySet simply extract the Version property value from the entity of interest.&lt;/p&gt;  &lt;p&gt;Now that we know when ETag's come back to us we likely should review how we would get the ETag value from the response.&amp;#160; ETag's are a common Http header and are well supported as shown in the sample below which retrieves an ETag from a HttpWebResponse.&lt;/p&gt;  &lt;pre&gt;HttpWebRequest request = CreateRequest();
&lt;span style="color: #0000ff"&gt;using&lt;/span&gt;(HttpWebResponse response = request.GetResponse())
{
    &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; etagValue = response.Headers[HttpResponseHeader.ETag];
    &lt;span style="color: #008000"&gt;// do something interesting with the ETag.&lt;/span&gt;
}&lt;/pre&gt;

&lt;h4&gt;Conditional Operations &lt;/h4&gt;

&lt;p&gt;Now that we have ETag's we can use these to execute operations in a conditional manner.&amp;#160; In order to support these sort of operations we've added support for two other headers to the service the, &amp;quot;&lt;a href="http://www.ieinspector.com/httpanalyzer/manual/index.html?process143.htm"&gt;If-Match&lt;/a&gt;&amp;quot; and, &amp;quot;&lt;a href="http://www.ieinspector.com/dominspector/manual/index.html?process145.htm"&gt;If-None-Match&amp;quot;&lt;/a&gt; headers.&amp;#160; We support these headers over all operations except for query though the following scenarios will likely fallout to be the most common:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Conditional GET&lt;/strong&gt; - This is actually the most common case, browsers typically operate in this manner.&amp;#160; In short, they first retrieve a entity which retrieves a entity with a ETag.&amp;#160; Then, on any subsequent calls to the same resouce a, &amp;quot;If-None-Match&amp;quot; header is provided on the request with the ETag from the initial GET operation.&amp;#160; If, and only if, the resource has changed then the complete entity definition is returned to the caller.&amp;#160; &lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;If the entity hasn't been updated then a 304 (NotModified) is returned and only the headers are returned to the caller.&amp;#160; &lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Conditional PUT&lt;/strong&gt; - In this case, we only want to update the contents of an entity if we know that we have the latest and greatest.&amp;#160; In this case we would provide a, &amp;quot;If-Match&amp;quot; header value with the ETag value of the entity that we wish to update.&amp;#160; &lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;In this case, if a later version of the entity is found in the service then we will return a 412 (PreConditionFailed) to the caller and the caller will have to retrieve the entity again and decide if they still need to update the entity again.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Conditional DELETE&lt;/strong&gt; - This is case pretty much the exact same as the Conditional PUT case.&amp;#160; The only difference here being that the verb we've chosen to use is the DELETE verb rather then PUT.&amp;#160; I wanted to explicitly call out though just to illustrate our support for it. &lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;HEAD support&lt;/h4&gt;

&lt;p&gt;There are some cases where the caller wishes to discover if the content they have is the latest greatest.&amp;#160; Typically, you would like this operation to be light weight in nature (which would exclude the returning of the entire entity) and only give you back the ETag or other relevant headers.&amp;#160; The Http specification provides a verb for this called, &amp;quot;HEAD&amp;quot; and with this sprint we've added support for it to the service.&amp;#160; &lt;/p&gt;

&lt;p&gt;You use the HEAD verb just like you would the normal GET operation except that we will only return back to you the headers that are of interest.&amp;#160; This verb, will perhaps not so obvious in usefulness here, will become more obvious in my one of my next posts.&lt;/p&gt;

&lt;h4&gt;What about SOAP?&lt;/h4&gt;

&lt;p&gt;While I haven't covered SOAP in this post we have added support for these operations to the SOAP service.&amp;#160; I'll be covering the specifics of how this works in my next post.&amp;#160; Keep an eye out for this shortly!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8637098" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SSDS/default.aspx">SSDS</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SQL+Server+Data+Services/default.aspx">SQL Server Data Services</category></item><item><title>Speaking at TechEd</title><link>http://blogs.msdn.com/jcurrier/archive/2008/05/01/speaking-at-teched.aspx</link><pubDate>Thu, 01 May 2008 18:58:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8447734</guid><dc:creator>jcurrier</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/jcurrier/comments/8447734.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jcurrier/commentrss.aspx?PostID=8447734</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jcurrier/rsscomments.aspx?PostID=8447734</wfw:comment><description>&lt;P&gt;I'm heading down to Orlando in a couple of weeks to give a talk about best practices when it comes to SSDS.&amp;nbsp; I'm working on my talk outline and was curious if there were any topics in particular that the community wanted to hear about in the talk?&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;Thoughts?&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8447734" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SSDS/default.aspx">SSDS</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SQL+Server+Data+Services/default.aspx">SQL Server Data Services</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/TechEd2008/default.aspx">TechEd2008</category></item><item><title>Good overview of using threads for multi container query in SSDS</title><link>http://blogs.msdn.com/jcurrier/archive/2008/04/14/good-overview-of-using-threads-for-multi-container-query-in-ssds.aspx</link><pubDate>Tue, 15 Apr 2008 06:30:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8396281</guid><dc:creator>jcurrier</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jcurrier/comments/8396281.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jcurrier/commentrss.aspx?PostID=8396281</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jcurrier/rsscomments.aspx?PostID=8396281</wfw:comment><description>&lt;p&gt;Eugenio has a good blog &lt;a href="http://blogs.msdn.com/eugeniop/archive/2008/04/14/litwarehr-on-ssds-part-v-searching-across-containers.aspx?CommentPosted=true#commentmessage"&gt;entry&lt;/a&gt; today describing using multiple threads to execute multi-container query.&amp;nbsp; Well worth the read.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8396281" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jcurrier/archive/tags/Services/default.aspx">Services</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SSDS/default.aspx">SSDS</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SQL+Server+Data+Services/default.aspx">SQL Server Data Services</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/Query/default.aspx">Query</category></item><item><title>Interested in partaking in a design review for SQL Server Data Services?</title><link>http://blogs.msdn.com/jcurrier/archive/2008/04/13/interested-in-partaking-in-a-design-review-for-sql-server-data-services.aspx</link><pubDate>Sun, 13 Apr 2008 09:54:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8386354</guid><dc:creator>jcurrier</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jcurrier/comments/8386354.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jcurrier/commentrss.aspx?PostID=8386354</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jcurrier/rsscomments.aspx?PostID=8386354</wfw:comment><description>&lt;P&gt;Are you interested in taking part in a design review of SQL Server Data Services?&amp;nbsp; Are you located in Silicon Valley?&amp;nbsp; If you answered yes to both of these questions then you're going to want check out Ryan's blog &lt;A class="" href="http://dunnry.com/blog/InterestedInSQLServerDataServices.aspx" mce_href="http://dunnry.com/blog/InterestedInSQLServerDataServices.aspx"&gt;here&lt;/A&gt; to find out details for attending.&amp;nbsp; Space is limited so act fast!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;--Jeff--&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8386354" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jcurrier/archive/tags/Services/default.aspx">Services</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SSDS/default.aspx">SSDS</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SQL+Server+Data+Services/default.aspx">SQL Server Data Services</category></item><item><title>cURL'ing up with SQL Server Data Services</title><link>http://blogs.msdn.com/jcurrier/archive/2008/04/13/curl-ing-up-with-sql-server-data-services.aspx</link><pubDate>Sun, 13 Apr 2008 09:47:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8386349</guid><dc:creator>jcurrier</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/jcurrier/comments/8386349.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jcurrier/commentrss.aspx?PostID=8386349</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jcurrier/rsscomments.aspx?PostID=8386349</wfw:comment><description>&lt;p&gt;We've begun working with some external customers (and a considerable number of internal ones) on the project and one of the first requests that came up was regarding the use of cURL.&amp;nbsp; &lt;/p&gt; &lt;p&gt;&lt;a href="http://curl.haxx.se/"&gt;cURL&lt;/a&gt;, as many of you already know, is a pretty cool command line utility which can be used to issue HTTP requests.&amp;nbsp; However we haven't, until this point, documented exactly how you can use the service from cURL.&amp;nbsp; This post will address that.&lt;/p&gt; &lt;h3&gt;Enumerating your Authority&lt;/h3&gt; &lt;p&gt;In this example I'll illustrate how you can query an authority for all of the containers that are located within it.&amp;nbsp; Before we get to this however I'll explain a bit more about how cURL functions.&amp;nbsp; &lt;/p&gt; &lt;p&gt;cURL uses various command line parameters to construct the HTTP request on your behalf.&amp;nbsp; As you might guess the -X parameter is used to specify the verb (HTTP method) that you wish to use on the request.&amp;nbsp; The -u parameter is used to specify the credentials to use and finally the last parameter is the URL you want to use.&amp;nbsp; &lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;em&gt;Command line syntax to query the authority:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;curl -X GET -u "&amp;lt;userid&amp;gt;:&amp;lt;password&amp;gt;" &lt;a href="http://&amp;lt;authority-id&amp;gt;.data.beta.mssds.com/v1/?q=''"&gt;http://&amp;lt;authority-id&amp;gt;.data.beta.mssds.com/v1/?q=''&lt;/a&gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;Output&lt;/em&gt;&lt;/strong&gt;  &lt;p&gt;&amp;lt;s:EntitySet xmlns:s="&lt;a href="http://schemas.microsoft.com/sitka/2008/03/&amp;quot;"&gt;http://schemas.microsoft.com/sitka/2008/03/"&lt;/a&gt; xmlns:xsi="&lt;a href="http://www.w3.org/2001/XMLSc"&gt;http://www.w3.org/2001/XMLSc&lt;/a&gt;&lt;br&gt;hema-instance" xmlns:x="&lt;a href="http://www.w3.org/2001/XMLSchema&amp;quot;"&gt;http://www.w3.org/2001/XMLSchema"&lt;/a&gt;&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;s:Container&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;s:Id&amp;gt;testcontainer&amp;lt;/s:Id&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;s:Version&amp;gt;1&amp;lt;/s:Version&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;/s:Container&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;s:Container&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;s:Id&amp;gt;testcontainer2&amp;lt;/s:Id&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;s:Version&amp;gt;1&amp;lt;/s:Version&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;/s:Container&amp;gt;&lt;br&gt;&amp;lt;/s:EntitySet&amp;gt;  &lt;h3&gt;Creating Containers and Entities&lt;/h3&gt; &lt;p&gt;As I've mentioned previously &lt;a href="http://blogs.msdn.com/jcurrier/archive/2008/03/17/some-sql-server-data-services-coding-examples.aspx"&gt;here&lt;/a&gt; we use the POST verb to create entities within SSDS.&amp;nbsp; Now, because specifying the entire payload for a POST could be cumbersome cURL allows you to specify the filename where the payload can be found.&amp;nbsp; This done use the, "--data" parameter and the, "@" symbol.&lt;/p&gt; &lt;p&gt;We'll begin with creating a container with cURL.&amp;nbsp; We'll start by creating a simple file called, "CurlContainer" containing the following XML payload:&lt;/p&gt; &lt;p&gt;&amp;lt;s:Container xmlns:s="&lt;a href="http://schemas.microsoft.com/sitka/2008/03/&amp;quot;"&gt;http://schemas.microsoft.com/sitka/2008/03/"&lt;/a&gt;&amp;gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;s:Id&amp;gt;CurlContainer&amp;lt;/s:Id&amp;gt; &lt;br&gt;&amp;lt;/s:Container&amp;gt;  &lt;p&gt;Now that this is complete we can construct the command line syntax that we'll need to send the request to the service.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;em&gt;Command line syntax to create the container:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;curl -X POST --data @CurlContainer -H "Content-Type: application/xml"&amp;nbsp; -u "&amp;lt;userid&amp;gt;:&amp;lt;password&amp;gt;" &lt;a href="http://&amp;lt;authority-id&amp;gt;.data.beta.mssds.com/v1/"&gt;http://&amp;lt;authority-id&amp;gt;.data.beta.mssds.com/v1/&lt;/a&gt;&lt;/p&gt; &lt;p&gt;A couple of things that you might notice here that are different from our prior syntax.&amp;nbsp; The first is that the verb has changed (that's pretty obvious).&amp;nbsp; The second item is that we've used the, "--data" parameter to specify the payload.&amp;nbsp; We didn't need to use that before since we were only querying the service.&amp;nbsp; &lt;/p&gt; &lt;p&gt;Finally, and perhaps most importantly, is that we specify the content type of data in the request.&amp;nbsp; This is done using the, "-H" parameter along with the header data.&amp;nbsp; &lt;u&gt;If this isn't specified then the request will be denied with a 400 so do remember to use it&lt;/u&gt;.&lt;/p&gt; &lt;p&gt;Now, when we query the authority as we did earlier I get the following output returned to me.&lt;/p&gt; &lt;p&gt;&amp;lt;s:EntitySet xmlns:s="&lt;a href="http://schemas.microsoft.com/sitka/2008/03/&amp;quot;"&gt;http://schemas.microsoft.com/sitka/2008/03/"&lt;/a&gt; xmlns:xsi="&lt;a href="http://www.w3.org/2001/XMLSchema-instance"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/a&gt;" xmlns:x="&lt;a href="http://www.w3.org/2001/XMLSchema&amp;quot;"&gt;http://www.w3.org/2001/XMLSchema"&lt;/a&gt;&amp;gt;&lt;br&gt;&lt;strong&gt;&amp;nbsp; &amp;lt;s:Container&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;s:Id&amp;gt;CurlContainer&amp;lt;/s:Id&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;s:Version&amp;gt;1&amp;lt;/s:Version&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;/s:Container&amp;gt;&lt;/strong&gt;&lt;br&gt;&amp;nbsp; &amp;lt;s:Container&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;s:Id&amp;gt;testcontainer&amp;lt;/s:Id&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;s:Version&amp;gt;1&amp;lt;/s:Version&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;/s:Container&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;s:Container&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;s:Id&amp;gt;testcontainer2&amp;lt;/s:Id&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;s:Version&amp;gt;1&amp;lt;/s:Version&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;/s:Container&amp;gt;&lt;br&gt;&amp;lt;/s:EntitySet&amp;gt;  &lt;p&gt;Switching to entity creation we find that not a lot has changed.&amp;nbsp; The only meaningful difference is the URL that we provide and the payload content.&amp;nbsp; Following the steps just described I can create a new entity, "CurlEntity" within the CurlContainer I just created.&amp;nbsp; Listed below is the payload I've created as well as the syntax used to create the entity.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;em&gt;Payload &lt;/em&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&amp;lt;CurlEntity xmlns:s="&lt;a href="http://schemas.microsoft.com/sitka/2008/03/&amp;quot;"&gt;http://schemas.microsoft.com/sitka/2008/03/"&lt;/a&gt; xmlns:xsi="&lt;a href="http://www.w3.org/2001/XMLSchema-instance&amp;quot; xmlns:x=&amp;quot;http://www.w3.org/2001/XMLSchema"&gt;http://www.w3.org/2001/XMLSchema-instance" xmlns:x="&lt;a href="http://www.w3.org/2001/XMLSchema&amp;quot;"&gt;http://www.w3.org/2001/XMLSchema&lt;/a&gt;"&lt;/a&gt;&amp;gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;s:Id&amp;gt;CurlEntity&amp;lt;/s:Id&amp;gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Name xsi:type="x:string"&amp;gt;Jeff Currier&amp;lt;/Name&amp;gt;&lt;br&gt;&amp;lt;/CurlEntity&amp;gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;Command line syntax to create the entity:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;curl -X POST -H "Content-Type: application/xml" --data @CurlEntity.xml -u "&amp;lt;userid&amp;gt;:&amp;lt;password&amp;gt;" &lt;a href="http://&amp;lt;authority-id&amp;gt;.data.beta.mssds.com/v1/CurlContainer"&gt;http://&amp;lt;authority-id&amp;gt;.data.beta.mssds.com/v1/CurlContainer&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Finally, let's just query the container to see my new data.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;em&gt;Command line syntax to query the container:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;curl -G -u "&amp;lt;userid&amp;gt;:&amp;lt;password&amp;gt;" &lt;a href="http://&amp;lt;authority-id&amp;gt;.data.beta.mssds.com/v1/CurlContainer?q=''"&gt;http://&amp;lt;authority-id&amp;gt;.data.beta.mssds.com/v1/CurlContainer?q=''&lt;/a&gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;Output&lt;/em&gt;&lt;/strong&gt;  &lt;p&gt;&amp;lt;s:EntitySet xmlns:s="&lt;a href="http://schemas.microsoft.com/sitka/2008/03/&amp;quot;"&gt;http://schemas.microsoft.com/sitka/2008/03/"&lt;/a&gt; xmlns:xsi="&lt;a href="http://www.w3.org/2001/XMLSc"&gt;http://www.w3.org/2001/XMLSc&lt;/a&gt;&lt;br&gt;hema-instance" xmlns:x="&lt;a href="http://www.w3.org/2001/XMLSchema&amp;quot;"&gt;http://www.w3.org/2001/XMLSchema"&lt;/a&gt;&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;CurlEntity&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;s:Id&amp;gt;CurlEntity&amp;lt;/s:Id&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;s:Version&amp;gt;1&amp;lt;/s:Version&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Name xsi:type="x:string"&amp;gt;Jeff Currier&amp;lt;/Name&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;/CurlEntity&amp;gt;&lt;br&gt;&amp;lt;/s:EntitySet&amp;gt;  &lt;h3&gt;Updating Entities&lt;/h3&gt; &lt;p&gt;Now that we can create and query things we need to have a way of updating them otherwise things just aren't that interesting.&amp;nbsp; We do this, as always in a RESTful service, using the PUT verb.&amp;nbsp; In this case I'm going to change the, "Name" property on my newly created entity to another name.&amp;nbsp; &lt;/p&gt; &lt;p&gt;Like we did previously we'll create a file which will contain the payload definition for the request.&amp;nbsp; I've created this file, "CurlEntity2.xml" and will provide this on the command line.&amp;nbsp; Listed below is both the payload as well as the command line syntax for updating.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;em&gt;Update Payload:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&amp;lt;CurlEntity xmlns:s="&lt;a href="http://schemas.microsoft.com/sitka/2008/03/&amp;quot;"&gt;http://schemas.microsoft.com/sitka/2008/03/"&lt;/a&gt; xmlns:xsi="&lt;a href="http://www.w3.org/2001/XMLSchema-instance&amp;quot; xmlns:x=&amp;quot;http://www.w3.org/2001/XMLSchema"&gt;http://www.w3.org/2001/XMLSchema-instance" xmlns:x="&lt;a href="http://www.w3.org/2001/XMLSchema&amp;quot;"&gt;http://www.w3.org/2001/XMLSchema&lt;/a&gt;"&lt;/a&gt;&amp;gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;s:Id&amp;gt;CurlEntity&amp;lt;/s:Id&amp;gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Name xsi:type="x:string"&amp;gt;Jason Hunter&amp;lt;/Name&amp;gt;&lt;br&gt;&amp;lt;/CurlEntity&amp;gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;Command line syntax for updating an entity:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;curl -X PUT --data @CurlEntity2.xml -H "Content-Type: application/xml" -u "&amp;lt;userid&amp;gt;:&amp;lt;password&amp;gt;" http://&amp;lt;authority-id&amp;gt;.data.beta.mssds.com/v1/CurlContainer/CurlEntity&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;em&gt;Output from listing the contents of the container&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&amp;lt;s:EntitySet xmlns:s="&lt;a href="http://schemas.microsoft.com/sitka/2008/03/&amp;quot;"&gt;http://schemas.microsoft.com/sitka/2008/03/"&lt;/a&gt; xmlns:xsi="&lt;a href="http://www.w3.org/2001/XMLSc"&gt;http://www.w3.org/2001/XMLSc&lt;/a&gt;&lt;br&gt;hema-instance" xmlns:x="&lt;a href="http://www.w3.org/2001/XMLSchema&amp;quot;"&gt;http://www.w3.org/2001/XMLSchema"&lt;/a&gt;&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;CurlEntity&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;s:Id&amp;gt;CurlEntity&amp;lt;/s:Id&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;s:Version&amp;gt;2&amp;lt;/s:Version&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;&amp;lt;Name xsi:type="x:string"&amp;gt;Jason Hunter&amp;lt;/Name&amp;gt;&lt;br&gt;&lt;/strong&gt;&amp;nbsp; &amp;lt;/CurlEntity&amp;gt;&lt;br&gt;&amp;lt;/s:EntitySet&amp;gt;  &lt;h3&gt;Deleteing Entities&lt;/h3&gt; &lt;p&gt;All things must come to an end even when it comes to entities.&amp;nbsp; We do this in RESTful services using the Delete verb.&amp;nbsp; Notice here that there is no need to specify a payload or a content-type header.&amp;nbsp; None of this is required as the service will determine what to delete based upon the URL.&amp;nbsp; &lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;em&gt;Command line syntax:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;curl -X DELETE -u "&amp;lt;userid&amp;gt;:&amp;lt;password&amp;gt;" &lt;a href="http://&amp;lt;authority-id&amp;gt;.data.beta.mssds.com/v1/CurlContainer/CurlEntity"&gt;http://&amp;lt;authority-id&amp;gt;.data.beta.mssds.com/v1/CurlContainer/CurlEntity&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;em&gt;Output from listing the contents of our container:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&amp;lt;s:EntitySet xmlns:s="&lt;a href="http://schemas.microsoft.com/sitka/2008/03/&amp;quot;"&gt;http://schemas.microsoft.com/sitka/2008/03/"&lt;/a&gt; xmlns:xsi="&lt;a href="http://www.w3.org/2001/XMLSchema-instance&amp;quot;"&gt;http://www.w3.org/2001/XMLSchema-instance"&lt;/a&gt; xmlns:x="&lt;a href="http://www.w3.org/2001/XMLSchema&amp;quot;/"&gt;http://www.w3.org/2001/XMLSchema"/&lt;/a&gt;&amp;gt;&lt;/p&gt; &lt;p&gt;That wraps up our cURL example for this evening.&amp;nbsp; If there are other languages or tools that you would be interested in seeing examples in please do let us know!&lt;/p&gt; &lt;p&gt;--Jeff--&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8386349" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jcurrier/archive/tags/Services/default.aspx">Services</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SSDS/default.aspx">SSDS</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SQL+Server+Data+Services/default.aspx">SQL Server Data Services</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/cURL/default.aspx">cURL</category></item><item><title>Check out Nigel &amp; Istvan over at Channel 9</title><link>http://blogs.msdn.com/jcurrier/archive/2008/04/08/check-out-nigel-istvan-over-at-channel-9.aspx</link><pubDate>Tue, 08 Apr 2008 07:08:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8367570</guid><dc:creator>jcurrier</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jcurrier/comments/8367570.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jcurrier/commentrss.aspx?PostID=8367570</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jcurrier/rsscomments.aspx?PostID=8367570</wfw:comment><description>&lt;p&gt;You can watch a good interview with Istvan and Nigel over on &lt;a href="http://channel9.msdn.com/ShowPost.aspx?PostID=395843"&gt;Channel 9.&lt;/a&gt;&amp;#160; The talk covers some of the interesting architecture, security and other topics.&amp;#160; Well worth the watch!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8367570" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jcurrier/archive/tags/Services/default.aspx">Services</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SSDS/default.aspx">SSDS</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SQL+Server+Data+Services/default.aspx">SQL Server Data Services</category></item><item><title>Interacting with SQL Server Data Services using SOAP</title><link>http://blogs.msdn.com/jcurrier/archive/2008/04/02/interacting-with-sql-server-data-services-using-soap.aspx</link><pubDate>Thu, 03 Apr 2008 06:43:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8353015</guid><dc:creator>jcurrier</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/jcurrier/comments/8353015.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jcurrier/commentrss.aspx?PostID=8353015</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jcurrier/rsscomments.aspx?PostID=8353015</wfw:comment><description>&lt;p&gt;In one of my prior &lt;a href="http://blogs.msdn.com/jcurrier/archive/2008/03/17/some-sql-server-data-services-coding-examples.aspx"&gt;posts&lt;/a&gt; I promised some SOAP examples to better illustrate how you can use SOAP to interact with SSDS.&amp;#160; Therefore, to honor that I've decided to write some up some examples of using SOAP with SSDS.&lt;/p&gt;  &lt;h3&gt;Setting Scope&lt;/h3&gt;  &lt;p&gt;In the SOAP client we really don't have the luxury of being able to easily determine the scope of a particular operation from the different segments of a URI.&amp;#160; Therefore, to make establishing the scope of a given operation easy we introduced the notion of a scope object to the SOAP interface.&amp;#160; &lt;/p&gt;  &lt;p&gt;This object captures all of the possible scopes that are valid for the service.&amp;#160; I've listed below both the Scope object definition as well as a description of what each of the settings mean in the context of the service.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Service Scope&lt;/strong&gt; - This the scope when a scope object instance is passed to the service without any of the properties set.&amp;#160; This would typically be the case when the intent is to create a new authority object in the service.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Authority Scope&lt;/strong&gt; - When just the authority id is specified on the scope object.&amp;#160; This is generally the case when the caller is attempting to create a container, retrieve the set (or a restricted set) of containers from a given authority or finally when attempting to simply retrieve a particular authority instance.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Container Scope&lt;/strong&gt; - As you might imagine this scope is established when both the authority and container id properties are set on the scope object.&amp;#160; This scope is typically used when querying within a container for a set of entities (or all entities), creating new entities, or deleting a specific container.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Entity Scope&lt;/strong&gt; - Used to narrow the focus of the operation to be performed down to the entity level.&amp;#160; This is typically used when the caller is attempting to update, retrieve or delete a specific entity within the service.&lt;/p&gt;  &lt;p&gt;The generated C# code for the Scope object.&lt;/p&gt;  &lt;pre&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; partial &lt;span style="color: #0000ff"&gt;struct&lt;/span&gt; Scope : System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged {
        
        [System.NonSerializedAttribute()]
        &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; System.Runtime.Serialization.ExtensionDataObject extensionDataField;
        
        &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; AuthorityIdField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; ContainerIdField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; EntityIdField;
        
        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; System.Runtime.Serialization.ExtensionDataObject ExtensionData {
            &lt;span style="color: #0000ff"&gt;get&lt;/span&gt; {
                &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.extensionDataField;
            }
            &lt;span style="color: #0000ff"&gt;set&lt;/span&gt; {
                &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.extensionDataField = &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;;
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute(IsRequired=&lt;span style="color: #0000ff"&gt;true&lt;/span&gt;)]
        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; AuthorityId {
            &lt;span style="color: #0000ff"&gt;get&lt;/span&gt; {
                &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.AuthorityIdField;
            }
            &lt;span style="color: #0000ff"&gt;set&lt;/span&gt; {
                &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; ((&lt;span style="color: #0000ff"&gt;object&lt;/span&gt;.ReferenceEquals(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.AuthorityIdField, &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;) != &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;)) {
                    &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.AuthorityIdField = &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;;
                    &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.RaisePropertyChanged(&amp;quot;&lt;span style="color: #8b0000"&gt;AuthorityId&lt;/span&gt;&amp;quot;);
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute()]
        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; ContainerId {
            &lt;span style="color: #0000ff"&gt;get&lt;/span&gt; {
                &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ContainerIdField;
            }
            &lt;span style="color: #0000ff"&gt;set&lt;/span&gt; {
                &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; ((&lt;span style="color: #0000ff"&gt;object&lt;/span&gt;.ReferenceEquals(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ContainerIdField, &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;) != &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;)) {
                    &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ContainerIdField = &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;;
                    &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.RaisePropertyChanged(&amp;quot;&lt;span style="color: #8b0000"&gt;ContainerId&lt;/span&gt;&amp;quot;);
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute()]
        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; EntityId {
            &lt;span style="color: #0000ff"&gt;get&lt;/span&gt; {
                &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.EntityIdField;
            }
            &lt;span style="color: #0000ff"&gt;set&lt;/span&gt; {
                &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; ((&lt;span style="color: #0000ff"&gt;object&lt;/span&gt;.ReferenceEquals(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.EntityIdField, &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;) != &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;)) {
                    &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.EntityIdField = &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;;
                    &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.RaisePropertyChanged(&amp;quot;&lt;span style="color: #8b0000"&gt;EntityId&lt;/span&gt;&amp;quot;);
                }
            }
        }
        
        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;event&lt;/span&gt; System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
        
        &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; RaisePropertyChanged(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; propertyName) {
            System.ComponentModel.PropertyChangedEventHandler propertyChanged = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.PropertyChanged;
            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; ((propertyChanged != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)) {
                propertyChanged(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; System.ComponentModel.PropertyChangedEventArgs(propertyName));
            }
        }
    }&lt;/pre&gt;

&lt;p&gt;So, now that we have some context about what scope is and what it's used to indicate within the service let's show some examples of using the service.&lt;/p&gt;

&lt;h3&gt;Creating Authorities&lt;/h3&gt;

&lt;p&gt;In this example I'd like to illustrate how to create an authority in the system.&amp;#160; As you may recall from some of other &lt;a href="http://dunnry.com/blog/EntitiesContainersAndAuthorities.aspx"&gt;posts&lt;/a&gt; on our data model the Authority is the top level domain, so to speak, for a set of containers.&amp;#160; &lt;/p&gt;

&lt;p&gt;All the containers created within a specific authority will be contained in a single data center.&amp;#160; During the authority creation process a domain name will be created automatically on your behalf.&amp;#160; This last point tends to be more important in the REST examples (from a programmatic point of view) but it will also have a greater significance in our later service releases.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;The code...&lt;/p&gt;

&lt;pre&gt;            &lt;span style="color: #008000"&gt;// Begin by creating an instance of our SOAP proxy class.&lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (SitkaSoapServiceClient client = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SitkaSoapServiceClient(&amp;quot;&lt;span style="color: #8b0000"&gt;SitkaSoapEndpoint&lt;/span&gt;&amp;quot;))
            {
                &lt;span style="color: #008000"&gt;// Next, set the credentials that will be used to associate the request with a known&lt;/span&gt;
                &lt;span style="color: #008000"&gt;// user in the system.  This user will also then become the, &amp;quot;owner&amp;quot; of this authority.&lt;/span&gt;
                client.ClientCredentials.UserName.UserName = &amp;quot;&lt;span style="color: #8b0000"&gt;my_user&lt;/span&gt;&amp;quot;;
                client.ClientCredentials.UserName.Password = &amp;quot;&lt;span style="color: #8b0000"&gt;my_password&lt;/span&gt;&amp;quot;;

                &lt;span style="color: #008000"&gt;// Create a new scope object at the service level.&lt;/span&gt;
                Scope serviceScope = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Scope();

                &lt;span style="color: #008000"&gt;// Next, create an Authority object and set the Id of that authority.&lt;/span&gt;
                Authority myNewAuthority = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Authority();
                myNewAuthority.Id = &amp;quot;&lt;span style="color: #8b0000"&gt;ssdsrocks&lt;/span&gt;&amp;quot;;

                &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;
                {
                    &lt;span style="color: #008000"&gt;// Proceed to create the authority object.&lt;/span&gt;
                    Scope authorityScope = client.Create(serviceScope, myNewAuthority);

                    &lt;span style="color: #008000"&gt;// Finally using the returned Scope object which is initialized to my &lt;/span&gt;
                    &lt;span style="color: #008000"&gt;// new authority object retrieve the authority.&lt;/span&gt;
                    Authority theAuthority = (Authority) client.Get(authorityScope);

                    Console.WriteLine(&amp;quot;&lt;span style="color: #8b0000"&gt;Here's my ID {0}&lt;/span&gt;&amp;quot;, theAuthority.Id);

                }&lt;span style="color: #0000ff"&gt;catch&lt;/span&gt;(FaultException&amp;lt;Error&amp;gt; ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }&lt;/pre&gt;

&lt;p&gt;The Results&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/InteractingwithSQLServerDataServicesusin_11BE4/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="208" alt="image" src="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/InteractingwithSQLServerDataServicesusin_11BE4/image_thumb.png" width="377" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h3&gt;Creating Containers&lt;/h3&gt;

&lt;p&gt;In the last example I gave an example of creating new authorities in SQL Server Data Services.&amp;#160; Now, let's go ahead and create some containers.&amp;#160; Recall that containers are the mechanism in our service that we use for partitioning data.&amp;#160; All of the data for a particular container will be located on a single machine within the cluster (with multiple replicas existing on other machines in the cluster).&amp;#160; &lt;/p&gt;

&lt;p&gt;Now, with no further delay creating containers.&lt;/p&gt;

&lt;p&gt;The code...&lt;/p&gt;

&lt;pre&gt;            &lt;span style="color: #008000"&gt;// Begin by creating an instance of our SOAP proxy class.&lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (SitkaSoapServiceClient client = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SitkaSoapServiceClient(&amp;quot;&lt;span style="color: #8b0000"&gt;SitkaSoapEndpoint&lt;/span&gt;&amp;quot;))
            {
                &lt;span style="color: #008000"&gt;// Next, set the credentials that will be used to associate the request with a known&lt;/span&gt;
                &lt;span style="color: #008000"&gt;// user in the system. &lt;/span&gt;
                client.ClientCredentials.UserName.UserName = &amp;quot;&lt;span style="color: #8b0000"&gt;my_user_id&lt;/span&gt;&amp;quot;;
                client.ClientCredentials.UserName.Password = &amp;quot;&lt;span style="color: #8b0000"&gt;my_password&lt;/span&gt;&amp;quot;;

                &lt;span style="color: #008000"&gt;// Create a new scope object at our new authority level.&lt;/span&gt;
                Scope authorityScope = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Scope();
                authorityScope.AuthorityId = &amp;quot;&lt;span style="color: #8b0000"&gt;ssdsrocks&lt;/span&gt;&amp;quot;;

                &lt;span style="color: #008000"&gt;// Next, create the new Container object and set the Id &lt;/span&gt;
                &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; containerId = &amp;quot;&lt;span style="color: #8b0000"&gt;MyMusic&lt;/span&gt;&amp;quot;;
                Container newContainer = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Container();
                newContainer.Id = containerId;

                &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;
                {
                    &lt;span style="color: #008000"&gt;// Proceed to create the container object.&lt;/span&gt;
                    Scope containerScope = client.Create(authorityScope, newContainer);

                    &lt;span style="color: #008000"&gt;// Now, rather than simply retrieve the new container let's query the authority&lt;/span&gt;
                    &lt;span style="color: #008000"&gt;// for it.&lt;/span&gt;
                    &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; query =
                        String.Format(@&amp;quot;&lt;span style="color: #8b0000"&gt;from e in entities where e.Id ==&amp;quot;&amp;quot;{0}&amp;quot;&amp;quot; select e&lt;/span&gt;&amp;quot;, containerId);

                    List&amp;lt;Entity&amp;gt; containers = client.Query(authorityScope, query);

                    &lt;span style="color: #008000"&gt;// Finally, let's print out the results of all the containers we've found.&lt;/span&gt;
                    &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt;(Container c &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; containers)
                    {
                        Console.WriteLine(&amp;quot;&lt;span style="color: #8b0000"&gt;Container id:{0}&lt;/span&gt;&amp;quot;, c.Id);
                    }
 

                }&lt;span style="color: #0000ff"&gt;catch&lt;/span&gt;(FaultException&amp;lt;Error&amp;gt; ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }&lt;/pre&gt;

&lt;p&gt;and the Results...&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/InteractingwithSQLServerDataServicesusin_11BE4/image_4.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="197" alt="image" src="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/InteractingwithSQLServerDataServicesusin_11BE4/image_thumb_1.png" width="386" border="0" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;

&lt;h3&gt;Creating Entities&lt;/h3&gt;

&lt;p&gt;Entities represent the really interesting stuff in the service.&amp;#160; These are the objects where the real data will be stored and later queried for.&amp;#160; In this example I will create some new entities (with some properties) and then query for a subset of the entities.&lt;/p&gt;

&lt;p&gt;The code.&lt;/p&gt;

&lt;pre&gt;            &lt;span style="color: #008000"&gt;// Begin by creating an instance of our SOAP proxy class.&lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (SitkaSoapServiceClient client = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SitkaSoapServiceClient(&amp;quot;&lt;span style="color: #8b0000"&gt;SitkaSoapEndpoint&lt;/span&gt;&amp;quot;))
            {
                &lt;span style="color: #008000"&gt;// Next, set the credentials that will be used to associate the request with a known&lt;/span&gt;
                &lt;span style="color: #008000"&gt;// user in the system. &lt;/span&gt;
                client.ClientCredentials.UserName.UserName = &amp;quot;&lt;span style="color: #8b0000"&gt;my_user_id&lt;/span&gt;&amp;quot;; 
                client.ClientCredentials.UserName.Password = &amp;quot;&lt;span style="color: #8b0000"&gt;my_password&lt;/span&gt;&amp;quot;;

                &lt;span style="color: #008000"&gt;// Create a new scope object at our new container level.&lt;/span&gt;
                Scope containerScope = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Scope();
                containerScope.AuthorityId = &amp;quot;&lt;span style="color: #8b0000"&gt;ssdsrocks&lt;/span&gt;&amp;quot;;
                containerScope.ContainerId = &amp;quot;&lt;span style="color: #8b0000"&gt;MyMusic&lt;/span&gt;&amp;quot;;

                &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;
                {
                    &lt;span style="color: #008000"&gt;// Create some entities with various properties.&lt;/span&gt;
                    Entity[] entities = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Entity[3];
                    entities[0] = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Entity();
                    entities[0].Id = &amp;quot;&lt;span style="color: #8b0000"&gt;1&lt;/span&gt;&amp;quot;;
                    entities[0].Kind = &amp;quot;&lt;span style="color: #8b0000"&gt;Album&lt;/span&gt;&amp;quot;;
                    entities[0].Properties = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Dictionary&amp;lt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;object&lt;/span&gt;&amp;gt;();
                    entities[0].Properties[&amp;quot;&lt;span style="color: #8b0000"&gt;Artist&lt;/span&gt;&amp;quot;] = &amp;quot;&lt;span style="color: #8b0000"&gt;The Shins&lt;/span&gt;&amp;quot;;
                    entities[0].Properties[&amp;quot;&lt;span style="color: #8b0000"&gt;Title&lt;/span&gt;&amp;quot;] = &amp;quot;&lt;span style="color: #8b0000"&gt;Chutes Too Narrow&lt;/span&gt;&amp;quot;;

                    entities[1] = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Entity();
                    entities[1].Id = &amp;quot;&lt;span style="color: #8b0000"&gt;2&lt;/span&gt;&amp;quot;;
                    entities[1].Kind = &amp;quot;&lt;span style="color: #8b0000"&gt;Album&lt;/span&gt;&amp;quot;;
                    entities[1].Properties = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Dictionary&amp;lt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;object&lt;/span&gt;&amp;gt;();
                    entities[1].Properties[&amp;quot;&lt;span style="color: #8b0000"&gt;Artist&lt;/span&gt;&amp;quot;] = &amp;quot;&lt;span style="color: #8b0000"&gt;Brett Dennen&lt;/span&gt;&amp;quot;;
                    entities[1].Properties[&amp;quot;&lt;span style="color: #8b0000"&gt;Title&lt;/span&gt;&amp;quot;] = &amp;quot;&lt;span style="color: #8b0000"&gt;So Much More&lt;/span&gt;&amp;quot;;

                    entities[2] = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Entity();
                    entities[2].Id = &amp;quot;&lt;span style="color: #8b0000"&gt;3&lt;/span&gt;&amp;quot;;
                    entities[2].Kind = &amp;quot;&lt;span style="color: #8b0000"&gt;Album&lt;/span&gt;&amp;quot;;
                    entities[2].Properties = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Dictionary&amp;lt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;object&lt;/span&gt;&amp;gt;();
                    entities[2].Properties[&amp;quot;&lt;span style="color: #8b0000"&gt;Artist&lt;/span&gt;&amp;quot;] = &amp;quot;&lt;span style="color: #8b0000"&gt;The Shins&lt;/span&gt;&amp;quot;;
                    entities[2].Properties[&amp;quot;&lt;span style="color: #8b0000"&gt;Title&lt;/span&gt;&amp;quot;] = &amp;quot;&lt;span style="color: #8b0000"&gt;Wincing the Night Away&lt;/span&gt;&amp;quot;;

                    &lt;span style="color: #008000"&gt;// NOTE: This is a unique property to this entity instance.&lt;/span&gt;
                    entities[2].Properties[&amp;quot;&lt;span style="color: #8b0000"&gt;Released&lt;/span&gt;&amp;quot;] = 2007m; &lt;span style="color: #008000"&gt;// treat as decimal. &lt;/span&gt;

                    &lt;span style="color: #008000"&gt;// Go ahead and create the entities in the service.&lt;/span&gt;
                    &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt;(Entity currentEntity &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; entities)
                    {
                        client.Create(containerScope, currentEntity);
                    }

                    &lt;span style="color: #008000"&gt;// Okay, so the entities are there now.  Let's first retrieve all the entities.&lt;/span&gt;
                    List&amp;lt;Entity&amp;gt; allEntities = client.Query(containerScope, &amp;quot;&lt;span style="color: #8b0000"&gt;from e in entities select e&lt;/span&gt;&amp;quot;);
                    
                    Console.WriteLine(&amp;quot;&lt;span style="color: #8b0000"&gt;All Entities in container are:&lt;/span&gt;&amp;quot;);
                    &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt;(Entity e &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; allEntities)
                    {
                        Console.WriteLine(&amp;quot;&lt;span style="color: #8b0000"&gt;Entity id = {0}&lt;/span&gt;&amp;quot;, e.Id);
                    }

                    &lt;span style="color: #008000"&gt;// Now, let's restrict the set of entities returned to the one (and only one) that&lt;/span&gt;
                    &lt;span style="color: #008000"&gt;// had a release date of 2007.&lt;/span&gt;
                    String query = String.Format(@&amp;quot;&lt;span style="color: #8b0000"&gt;from e in entities where e[&amp;quot;&amp;quot;Released&amp;quot;&amp;quot;] == 2007 select e&lt;/span&gt;&amp;quot;);
                    List&amp;lt;Entity&amp;gt; entityResults = client.Query(containerScope, query);

                    Console.WriteLine(&amp;quot;&lt;span style="color: #8b0000"&gt;All Entities with a Released property set to 2007:&lt;/span&gt;&amp;quot;);
                    &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (Entity e &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; entityResults)
                    {
                        Console.WriteLine(&amp;quot;&lt;span style="color: #8b0000"&gt;Entity id = {0}&lt;/span&gt;&amp;quot;, e.Id);
                    }

                }&lt;span style="color: #0000ff"&gt;catch&lt;/span&gt;(FaultException&amp;lt;Error&amp;gt; ex)
                {
                    Console.WriteLine(ex.Detail.Message);
                }
            }&lt;/pre&gt;

&lt;pre&gt;The Results...&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/InteractingwithSQLServerDataServicesusin_11BE4/image_6.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="174" alt="image" src="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/InteractingwithSQLServerDataServicesusin_11BE4/image_thumb_2.png" width="384" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;So, that wraps up the SOAP examples for tonight.&amp;#160; Hope you enjoy them and if you have questions (or other examples that you would like to see) please let me a comment back so that I can try to get it out there for you.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;--Jeff--&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8353015" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SSDS/default.aspx">SSDS</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SQL+Server+Data+Services/default.aspx">SQL Server Data Services</category></item><item><title>What questions do you have about SQL Server Data Services?</title><link>http://blogs.msdn.com/jcurrier/archive/2008/03/20/what-questions-do-you-have-about-sql-server-data-services.aspx</link><pubDate>Fri, 21 Mar 2008 06:15:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8328365</guid><dc:creator>jcurrier</dc:creator><slash:comments>10</slash:comments><comments>http://blogs.msdn.com/jcurrier/comments/8328365.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jcurrier/commentrss.aspx?PostID=8328365</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jcurrier/rsscomments.aspx?PostID=8328365</wfw:comment><description>&lt;P&gt;So,&lt;/P&gt;
&lt;P&gt;I've written several posts now around coding (in C# and in Java) about using SSDS.&amp;nbsp; So, I'm a bit curious if anyone out there has specific questions that either I (or others on team) might be able to answer.&amp;nbsp; This could be code related, design related, etc.&amp;nbsp; So, what questions do you have?&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--Jeff--&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8328365" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SSDS/default.aspx">SSDS</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SQL+Server+Data+Services/default.aspx">SQL Server Data Services</category></item><item><title>SQL Server Data Services Meet Java</title><link>http://blogs.msdn.com/jcurrier/archive/2008/03/19/sql-server-data-services-meet-java.aspx</link><pubDate>Wed, 19 Mar 2008 08:20:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8324797</guid><dc:creator>jcurrier</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/jcurrier/comments/8324797.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jcurrier/commentrss.aspx?PostID=8324797</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jcurrier/rsscomments.aspx?PostID=8324797</wfw:comment><description>&lt;P&gt;In my last post I covered a simple example of querying SSDS using C#, HttpWebRequest and XLinq.&amp;nbsp; Today, I thought I'd try to use another language (one we at Microsoft didn't have a hand in creating) Java.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;As I did in my last post I'm going to start with a little bit of infrastructure.&amp;nbsp; It's worth noting at this point that I'm using the &lt;A href="http://hc.apache.org/httpclient-3.x/" mce_href="http://hc.apache.org/httpclient-3.x/"&gt;HttpClient&lt;/A&gt; libraries that are freely available from the Jakarta Commons project of Apache.&amp;nbsp; This makes working with REST services pretty painless in the Java development environment. &lt;/P&gt;
&lt;H3&gt;Making Requests&lt;/H3&gt;
&lt;P&gt;The first thing that we'll need to construct is a way for us to issue requests to the SSDS service.&amp;nbsp; As I did previously, I've created a simple helper method to make this easier for me to do my work.&amp;nbsp; This method simply takes in the HTTP Method, the URI, and finally a string to use as the request body.&amp;nbsp; It will return to the caller the body of the response that we received back from the server.&lt;/P&gt;&lt;PRE&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt; String IssueRequest(String method,
                                       String url,
    		                       String body) &lt;SPAN style="COLOR: #0000ff"&gt;throws&lt;/SPAN&gt; Exception
    {
    	String response = "&lt;SPAN style="COLOR: #8b0000"&gt;&lt;/SPAN&gt;";
    	
    	&lt;SPAN style="COLOR: #008000"&gt;// Define the HTTP client that we'll use.&lt;/SPAN&gt;
        HttpClient client = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; HttpClient();
	HttpMethod requestMethod = &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;;
		
	&lt;SPAN style="COLOR: #008000"&gt;// Choose the method we'll be using to issue the request.&lt;/SPAN&gt;
	&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(method.equals("&lt;SPAN style="COLOR: #8b0000"&gt;GET&lt;/SPAN&gt;"))
	{
            requestMethod = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; GetMethod(url);
	}
	&lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (method.equals("&lt;SPAN style="COLOR: #8b0000"&gt;POST&lt;/SPAN&gt;"))
	{
            requestMethod = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; PostMethod(url);
            ((PostMethod)requestMethod).setRequestBody(body);
            ((PostMethod)requestMethod).setRequestHeader("&lt;SPAN style="COLOR: #8b0000"&gt;Content-Type&lt;/SPAN&gt;", XmlContentType);
	}
	&lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(method.equals("&lt;SPAN style="COLOR: #8b0000"&gt;PUT&lt;/SPAN&gt;"))
	{
            requestMethod = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; PutMethod(url);&lt;/PRE&gt;&lt;PRE&gt;            ((PutMethod)requestMethod).setRequestBody(body);
            ((PutMethod)requestMethod).setRequestHeader("&lt;SPAN style="COLOR: #8b0000"&gt;Content-Type&lt;/SPAN&gt;", XmlContentType);
	}
	&lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;(method.equals("&lt;SPAN style="COLOR: #8b0000"&gt;DELETE&lt;/SPAN&gt;"))
	{
            requestMethod = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; DeleteMethod(url);
	}
	&lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt;
	{
&lt;SPAN style="COLOR: #0000ff"&gt;&lt;FONT color=#000000&gt;            &lt;/FONT&gt;throw&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; Exception("&lt;SPAN style="COLOR: #8b0000"&gt;Unsupported method type provided&lt;/SPAN&gt;");
	}
		   
	URL requestUrl = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; URL(url);
	&lt;SPAN style="COLOR: #0000ff"&gt;try&lt;/SPAN&gt;
	{
	    &lt;SPAN style="COLOR: #008000"&gt;// Next, set the credentials we'll be using on the request.&lt;/SPAN&gt;
            Credentials defaultcreds = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; UsernamePasswordCredentials(UserId, UserPw);
            client.getState().setCredentials(
	       		&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; AuthScope(requestUrl.getHost(), 80, AuthScope.ANY_REALM), defaultcreds);
			
	    &lt;SPAN style="COLOR: #008000"&gt;// Then, state that we do want to do authentication on these requests.&lt;/SPAN&gt;
            requestMethod.setDoAuthentication(&lt;SPAN style="COLOR: #0000ff"&gt;true&lt;/SPAN&gt;);

&lt;SPAN style="COLOR: #008000"&gt;            // Provide custom retry handler if a retry is necessary.. Quite Nice actually&lt;/SPAN&gt;
            requestMethod.getParams().setParameter(
		HttpMethodParams.RETRY_HANDLER,
		   &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; DefaultHttpMethodRetryHandler(3, &lt;SPAN style="COLOR: #0000ff"&gt;false&lt;/SPAN&gt;));

            /&lt;SPAN style="COLOR: #008000"&gt;/ Execute the method.&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #0000ff"&gt;            int&lt;/SPAN&gt; statusCode = client.executeMethod(requestMethod);
&lt;SPAN style="COLOR: #0000ff"&gt;&lt;FONT color=#000000&gt;            &lt;/FONT&gt;if&lt;/SPAN&gt; (statusCode != HttpStatus.SC_OK)
            {
                System.err.println("&lt;SPAN style="COLOR: #8b0000"&gt;Method failed: &lt;/SPAN&gt;"
                    + requestMethod.getStatusLine());
            }

&lt;SPAN style="COLOR: #008000"&gt;            // Read the response body.&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #0000ff"&gt;&lt;FONT color=#000000&gt;            &lt;/FONT&gt;byte&lt;/SPAN&gt;[] responseBody = requestMethod.getResponseBody();

&lt;SPAN style="COLOR: #008000"&gt;&lt;FONT color=#000000&gt;            &lt;/FONT&gt;// NOTE: Simplifying assumption.  Assume all returned content at this&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #008000"&gt;&lt;FONT color=#000000&gt;            &lt;/FONT&gt;//       is string data.&lt;/SPAN&gt;
            response = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; String(responseBody);
         } 
&lt;SPAN style="COLOR: #0000ff"&gt;&lt;FONT color=#000000&gt;         &lt;/FONT&gt;catch&lt;/SPAN&gt; (HttpException e)
         {
&lt;SPAN style="COLOR: #0000ff"&gt;&lt;FONT color=#000000&gt;             &lt;/FONT&gt;return&lt;/SPAN&gt; e.getMessage();
         } 
&lt;SPAN style="COLOR: #0000ff"&gt;&lt;FONT color=#000000&gt;         &lt;/FONT&gt;catch&lt;/SPAN&gt; (IOException e)
         {
&lt;SPAN style="COLOR: #0000ff"&gt;&lt;FONT color=#000000&gt;             &lt;/FONT&gt;return&lt;/SPAN&gt; e.getMessage();
         } 
&lt;SPAN style="COLOR: #0000ff"&gt;&lt;FONT color=#000000&gt;         &lt;/FONT&gt;finally&lt;/SPAN&gt;
         {
&lt;SPAN style="COLOR: #008000"&gt;&lt;FONT color=#000000&gt;             &lt;/FONT&gt;// Release the connection.&lt;/SPAN&gt;
             requestMethod.releaseConnection();
         }
		
&lt;SPAN style="COLOR: #0000ff"&gt;         return&lt;/SPAN&gt; response;
    } &lt;/PRE&gt;
&lt;H3&gt;It's all in the presentation&lt;/H3&gt;
&lt;P&gt;Okay, so now we can make requests to the service and we can read in our responses fine let's go ahead try to make something a bit more interesting.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;In the last example you might recall the data model that we used had a Northwind origin if you like (read more &lt;A href="http://blogs.msdn.com/jcurrier/archive/2008/03/17/some-sql-server-data-services-coding-examples.aspx" mce_href="http://blogs.msdn.com/jcurrier/archive/2008/03/17/some-sql-server-data-services-coding-examples.aspx"&gt;here&lt;/A&gt;).&amp;nbsp; I've decided to keep with this basic storage model and construct a JFC (I still think of it as Swing) application which will allow me to issue ad-hoc queries against my service.&amp;nbsp; I've inserted a screen shot of this below, forgive the UI my JFC skills aren't quite as sharp as they used to be ;-)&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/SQLServerDataServicesMeetJava_13A1D/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/SQLServerDataServicesMeetJava_13A1D/image_2.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=375 alt=image src="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/SQLServerDataServicesMeetJava_13A1D/image_thumb.png" width=711 border=0 mce_src="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/SQLServerDataServicesMeetJava_13A1D/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;What I've got here is a data bound combobox which allows me to determine the container&amp;nbsp; I'd like to issue my query against.&amp;nbsp; Next to that is a textbox whose text value will be used for my query text.&amp;nbsp; Then, as you might imagine, after I execute the query the results (in wire format) will be displayed in the results TextArea.&lt;/P&gt;
&lt;P&gt;Let's start with how we retrieve the container Id's.&amp;nbsp; Listed below is the code I'm using to retrieve the container id's.&lt;/P&gt;&lt;PRE&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt; String[] retrieveCustomerIds()
    {
    	&lt;SPAN style="COLOR: #008000"&gt;// Construct the URI with our query in that will be used to retrieve&lt;/SPAN&gt;
    	&lt;SPAN style="COLOR: #008000"&gt;// all of the containers.  In this case, since the query is empty we will&lt;/SPAN&gt;
    	&lt;SPAN style="COLOR: #008000"&gt;// retrieve all the containers within the, "mix08-demo" authority.&lt;/SPAN&gt;
    	String customerQuery = "&lt;SPAN style="COLOR: #8b0000"&gt;http://mix08-demo.data.sitka.microsoft.com/v1/?q=&lt;/SPAN&gt;";
    	String[] customerIds = &lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;;
    	
    	&lt;SPAN style="COLOR: #0000ff"&gt;try&lt;/SPAN&gt;
    	{&lt;/PRE&gt;&lt;PRE&gt;            &lt;SPAN style="COLOR: #008000"&gt;// Next, issue the GET request to retrieve the data.  No body is necessary&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #008000"&gt;&lt;FONT color=#000000&gt;            /&lt;/FONT&gt;/ in the request (nor is it allowed).&lt;/SPAN&gt;
            String response = IssueRequest("&lt;SPAN style="COLOR: #8b0000"&gt;GET&lt;/SPAN&gt;", customerQuery, "&lt;SPAN style="COLOR: #8b0000"&gt;&lt;/SPAN&gt;");

            DocumentBuilderFactory factory =  DocumentBuilderFactory.newInstance();
            factory.setNamespaceAware(&lt;SPAN style="COLOR: #0000ff"&gt;true&lt;/SPAN&gt;);
            DocumentBuilder docBuilder = factory.newDocumentBuilder();
            InputSource inStream = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; InputSource();
            inStream.setCharacterStream(&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; StringReader(response));
        	
            &lt;SPAN style="COLOR: #008000"&gt;// Read the response we got back from the server into a document.&lt;/SPAN&gt;
            Document responseDoc = docBuilder.parse(inStream);

            &lt;SPAN style="COLOR: #008000"&gt;// Create an XPath expression to retrieve just the customer id's from the set of the containers&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #008000"&gt;// that were returned.&lt;/SPAN&gt;
            XPathFactory xpathFactory = XPathFactory.newInstance();
            XPath xpath = xpathFactory.newXPath();

            MyNamespaceContext ctx = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; MyNamespaceContext();
            xpath.setNamespaceContext(ctx);

            XPathExpression expr 
             = xpath.compile("&lt;SPAN style="COLOR: #8b0000"&gt;/s:EntitySet/s:Container/s:Id/text()&lt;/SPAN&gt;");

            &lt;SPAN style="COLOR: #008000"&gt;// execute the XPath expression and copy the results into a string array for data binding.&lt;/SPAN&gt;
            Object result = expr.evaluate(responseDoc, XPathConstants.NODESET);
            NodeList nodes = (NodeList) result;
            &lt;SPAN style="COLOR: #0000ff"&gt;int&lt;/SPAN&gt; containerCount = nodes.getLength();
            customerIds = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; String[containerCount];
        	
            &lt;SPAN style="COLOR: #008000"&gt;// finally, add each of the container id's to the list of strings that&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #008000"&gt;// we will return to the caller.&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #0000ff"&gt;for&lt;/SPAN&gt; (&lt;SPAN style="COLOR: #0000ff"&gt;int&lt;/SPAN&gt; i = 0; i &amp;lt; containerCount; i++) 
            {
            	customerIds[i] = nodes.item(i).getNodeValue();
            }
    	}&lt;SPAN style="COLOR: #0000ff"&gt;catch&lt;/SPAN&gt;(Exception ex)
    	{
    	    String errorMsg = ex.getMessage();
    	    &lt;SPAN style="COLOR: #008000"&gt;// Do something more interesting here later.&lt;/SPAN&gt;
    	    System.out.println(errorMsg);
    	}

    	&lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; customerIds;
    }&lt;/PRE&gt;
&lt;P&gt;Pretty easy stuff, most of the work is actually in processing the response (this is where the JAXB strongly typed sample I referred to last time would be quite handy).&amp;nbsp; Anyway, keeping things relatively simple we simply read the response into a XML Document, compose a XPath expression over it extracting out just the Id's of the containers and then place each of these into a String array which is then returned back to the caller to later be used for data binding the combo box.&amp;nbsp; Not that bad.&lt;/P&gt;
&lt;H3&gt;It's all in the Query&lt;/H3&gt;
&lt;P&gt;Now, that we can select the container that we wish to query over let's go ahead implement the code which actually does the query.&amp;nbsp; The code listing below illustrates how to do this.&lt;/P&gt;&lt;PRE&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt; processQueryRequest()
    {
    	String queryUrl = String.format("&lt;SPAN style="COLOR: #8b0000"&gt;%s%s?q='%s'&lt;/SPAN&gt;", 
    			"&lt;SPAN style="COLOR: #8b0000"&gt;http://mix08-demo.data.sitka.microsoft.com/v1/&lt;/SPAN&gt;", 
    			containerId, java.net.URLEncoder.encode(txtQuery.getText()));
    	
    	&lt;SPAN style="COLOR: #0000ff"&gt;try&lt;/SPAN&gt;
    	{
    	    String response = IssueRequest("&lt;SPAN style="COLOR: #8b0000"&gt;GET&lt;/SPAN&gt;", queryUrl, "&lt;SPAN style="COLOR: #8b0000"&gt;&lt;/SPAN&gt;");
    		
    	    txtResults.setText(response);
    		
    	}&lt;SPAN style="COLOR: #0000ff"&gt;catch&lt;/SPAN&gt;(Exception ex)
    	{&lt;/PRE&gt;&lt;PRE&gt;            // Do something more interesting here...
    	    System.&lt;SPAN style="COLOR: #0000ff"&gt;out&lt;/SPAN&gt;.println(ex.getMessage());
    	}
    }&lt;/PRE&gt;
&lt;P&gt;The first thing we do is to construct the URI that will be used on our request.&amp;nbsp; There's a couple of components to this.&amp;nbsp; The first is the location of the service (prefixed by our authority id), the second bit is the id of the container that we wish to query and the final piece is the encoded query text that we wish to use for the query.&lt;/P&gt;
&lt;P&gt;Next, since we have the URI properly formatted we then go ahead and issue the GET request to the server and receive back a response.&amp;nbsp; The text of the response body is then inserted directly into the results area.&amp;nbsp; I've included some sample screenshots here illustrating requests that were valid and some that I made which were intentionally invalid just to, hopefully, illustrate that everything is really working here.&lt;/P&gt;
&lt;P&gt;Query of the entire container&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/SQLServerDataServicesMeetJava_13A1D/image_4.png" mce_href="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/SQLServerDataServicesMeetJava_13A1D/image_4.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=392 alt=image src="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/SQLServerDataServicesMeetJava_13A1D/image_thumb_1.png" width=743 border=0 mce_src="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/SQLServerDataServicesMeetJava_13A1D/image_thumb_1.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Query for just the customer within a container&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/SQLServerDataServicesMeetJava_13A1D/image_6.png" mce_href="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/SQLServerDataServicesMeetJava_13A1D/image_6.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=392 alt=image src="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/SQLServerDataServicesMeetJava_13A1D/image_thumb_2.png" width=742 border=0 mce_src="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/SQLServerDataServicesMeetJava_13A1D/image_thumb_2.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Where's the Where&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/SQLServerDataServicesMeetJava_13A1D/image_8.png" mce_href="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/SQLServerDataServicesMeetJava_13A1D/image_8.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=391 alt=image src="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/SQLServerDataServicesMeetJava_13A1D/image_thumb_3.png" width=749 border=0 mce_src="http://blogs.msdn.com/blogfiles/jcurrier/WindowsLiveWriter/SQLServerDataServicesMeetJava_13A1D/image_thumb_3.png"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hopefully, this post illustrates a bit of what you can do with SQL Server Data Services with Java.&amp;nbsp; As I mentioned I'll try to post a Strong Typing example here using JAXB shortly.&amp;nbsp; I'll do the same for C# as well if &lt;A href="http://blogs.msdn.com/hunter-gatherer/" mce_href="http://blogs.msdn.com/hunter-gatherer/"&gt;Jason&lt;/A&gt; doesn't beat me to it :-)&lt;/P&gt;
&lt;P&gt;--Jeff--&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8324797" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jcurrier/archive/tags/Java/default.aspx">Java</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SSDS/default.aspx">SSDS</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SQL+Server+Data+Services/default.aspx">SQL Server Data Services</category></item><item><title>Jason's got some SSDS examples as well</title><link>http://blogs.msdn.com/jcurrier/archive/2008/03/18/jason-s-got-some-ssds-examples-as-well.aspx</link><pubDate>Tue, 18 Mar 2008 22:39:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8320811</guid><dc:creator>jcurrier</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jcurrier/comments/8320811.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jcurrier/commentrss.aspx?PostID=8320811</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jcurrier/rsscomments.aspx?PostID=8320811</wfw:comment><description>&lt;P&gt;Jason Hunter, dev lead on the SQL Server Data Services team, has posted up some coding examples as well for SSDS.&amp;nbsp; You can check these out &lt;A href="http://blogs.msdn.com/hunter-gatherer/archive/2008/03/18/ssds-patterns-part-1-master-detail-in-a-heterogeneous-world.aspx" mce_href="http://blogs.msdn.com/hunter-gatherer/archive/2008/03/18/ssds-patterns-part-1-master-detail-in-a-heterogeneous-world.aspx"&gt;here&lt;/A&gt;.&amp;nbsp; In this example Jason does a Master-Details WinForm app.&amp;nbsp; Pretty cool stuff...&amp;nbsp; &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8320811" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SSDS/default.aspx">SSDS</category><category domain="http://blogs.msdn.com/jcurrier/archive/tags/SQL+Server+Data+Services/default.aspx">SQL Server Data Services</category></item></channel></rss>