{"id":613,"date":"2012-09-26T16:13:15","date_gmt":"2012-09-26T16:13:15","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/odatateam\/2012\/09\/26\/wcf-data-service-5-1-0-rc2-released\/"},"modified":"2012-09-26T16:13:15","modified_gmt":"2012-09-26T16:13:15","slug":"wcf-data-service-5-1-0-rc2-released","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/odata\/wcf-data-service-5-1-0-rc2-released\/","title":{"rendered":"WCF Data Service 5.1.0-rc2 Released"},"content":{"rendered":"<p>Today we are releasing <a href=\"https:\/\/nuget.org\/packages\/Microsoft.Data.Services\/5.1.0-rc2\" target=\"_blank\">refreshed NuGet packages<\/a> as well as <a href=\"https:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=34773\" target=\"_blank\">an installer for WCF Data Services 5.1.0-rc2<\/a>. This RC is very close to complete. We do still have a few optimizations to make in the payload, but this RC is very representative of the final product.<\/p>\n<p>The RC introduces several new features:<\/p>\n<ul>\n<li><strike>JSON Light<\/strike> The new JSON serialization format<\/li>\n<li>$format\/$callback<\/li>\n<li>New client-side events for more control over the request\/response lifecycle<\/li>\n<\/ul>\n<h3>The new JSON serialization format<\/h3>\n<p>We\u2019ve <a href=\"http:\/\/blogs.msdn.com\/b\/astoriateam\/archive\/2012\/04\/17\/json-light-sample-payloads.aspx\" target=\"_blank\">blogged<\/a> <a href=\"https:\/\/www.odata.org\/blog\/2012\/1\/19\/format-efficiency-take-2-really-clean-json\" target=\"_blank\">a few times<\/a> about the <a href=\"http:\/\/www.bitwhys.com\/odata-101-enabling-json-light-from-the-wcf-ds-5-1-0-rc1-client\/\" target=\"_blank\">new JSON serialization format<\/a>. We think this new format has the feel of a custom REST API with the benefits of a standardized format. What does that mean exactly?<\/p>\n<h4>The feel of a custom REST API<\/h4>\n<p>If you were to create a custom REST API, you probably wouldn\u2019t create a lot of ceremony in the API. For example, if you were to GET a single contact, the payload might look like the payload below. In this payload, objects are simple JSON objects with name\/value pairs representing most properties and arrays representing collections. In fact, the only indicator we have that this is an OData payload is the first name\/value pair, which helps to disambiguate what is in the payload.<\/p>\n<pre>{\n   &quot;odata.metadata&quot;:&quot;http:\/\/contacts.svc\/$metadata#MyContactsService\/Contacts\/@Element&quot;,\n   &quot;LastUpdatedAt&quot;:&quot;2012-09-24T10:18:57.2183229-07:00&quot;,\n   &quot;FirstName&quot;:&quot;Pilar&quot;,\n   &quot;LastName&quot;:&quot;Ackerman&quot;,\n   &quot;Age&quot;:25,\n   &quot;Address&quot;:{\n      &quot;StreetAddress&quot;:&quot;5678 2nd Street&quot;,\n      &quot;City&quot;:&quot;New York&quot;,\n      &quot;State&quot;:&quot;NY&quot;,\n      &quot;PostalCode&quot;:&quot;98052&quot;\n   },\n   &quot;EmailAddresses&quot;:[&quot;pilar@contoso.com&quot;,&quot;packerman@cohowinery.com&quot;],\n   &quot;PhoneNumbers&quot;:[\n      {\n         &quot;Type&quot;:&quot;home&quot;,\n         &quot;Number&quot;:&quot;(212) 555-0162&quot;\n      },\n      {\n         &quot;Type&quot;:&quot;fax&quot;,\n         &quot;Number&quot;:&quot;(646) 555-0157&quot;\n      }\n   ]\n}<\/pre>\n<p>In an upcoming blog post, we\u2019ll dig more into what\u2019s so awesome about this new format.<\/p>\n<h4>The benefits of a standardized format<\/h4>\n<p>One of the reasons OData is so powerful is that it has a very predictable set of patterns that enable generic clients to communicate effectively with a variety of servers. This is very different from the custom REST API world, where clients need to read detailed documentation on each service they plan to consume to determine things like:<\/p>\n<ul>\n<li>How do I construct URLs?<\/li>\n<li>What is the schema of the request and response payloads?<\/li>\n<li>What HTTP verbs are supported, and what do they do?<\/li>\n<li>How do I format the request and response payloads?<\/li>\n<li>How do I do advanced operations like custom queries, sorting, and paging?<\/li>\n<\/ul>\n<h4>Standardization + custom feel = new format<\/h4>\n<p>When we combine the terseness and custom feel of the new format with the power of standardization, we get a payload that is only ~10% of the size of AtomPub but is still capable of producing the same strong metadata framework.<\/p>\n<h3>Code gen<\/h3>\n<p>We\u2019ve simplified the process for telling the client to ask for the new serialization format. Now all you need to do is call <code>context.UseJsonFormatWithDefaultServiceModel()<\/code> (the jury\u2019s out as to whether this will be the final API name, but you can be sure it will be as simple as a single method call). To get to that level of simplicity, we had to modify some things in code gen, so you\u2019ll need to <a href=\"https:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=34773\" target=\"_blank\">download the installer<\/a> we just released if you want to simplify the process of bootstrapping a client.<\/p>\n<h3>$format\/$callback<\/h3>\n<p>In this release we\u2019ve also provided in-the-box support for $format and $callback. These two system query options enable JSONP scenarios from many JavaScript clients. As a personal comment, I\u2019ve also really appreciated not having to jump into Fiddler quite as much to look at JSON responses.<\/p>\n<h3>New client-side events<\/h3>\n<p>Finally, we have added two new events on the client side.<\/p>\n<h4>BuildingRequest<\/h4>\n<p>SendingRequest2 (and its deprecated predecessor SendingRequest) fires after the request is built. WebRequest does not allow you to modify the URL after construction. The new event lets you modify the URL before we build the underlying request, giving you full control over the request.<\/p>\n<h4>ReceivingResponse<\/h4>\n<p>This is an event the community has requested several times. When we receive ANY response on the client, we will fire this event so you can examine response headers and more.<\/p>\n<h3>But wait, there\u2019s more\u2026<\/h3>\n<p>There are still some things for us to do, but most applications will be unaffected by them (or will experience a free performance boost when we RTW). Please understand that these are our current plans, not promises. That said, here\u2019s the remaining list of work we hope to complete by RTW:<\/p>\n<ul>\n<li>Relative URLs: When the server generates a URL and that URL actually needs to be in the new JSON serialization format, the server should automatically try to make it a relative URL.<\/li>\n<li>Actions\/functions: There\u2019s a little bit more smoothing necessary for action and function support.<\/li>\n<li>Disable the new format: Hopefully you\u2019d never want to do this, but we have a common practice of allowing you to disable features in WCF Data Services.<\/li>\n<li>Bugs: We have some bugs and inconsistencies that we already know about that need to be fixed before we have release quality.<\/li>\n<\/ul>\n<h3>Known Issues<\/h3>\n<p>Among the other bugs and issues we\u2019ve already identified, you should be aware that if you install the MSI referenced above, any new code gen\u2019d service references will require the project to reference WCF Data Services 5.1.0. We will have an acceptable resolution for this problem by RTW.<\/p>\n<h3>We need your help<\/h3>\n<p>This is a big release. We could really use your feedback, comments and bug reports as we wind down this release and prepare to RTW. Feel free to leave a comment below or e-mail me directly at <a href=\"mailto:mastaffo@microsoft.com\">mastaffo@microsoft.com<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today we are releasing refreshed NuGet packages as well as an installer for WCF Data Services 5.1.0-rc2. This RC is very close to complete. We do still have a few optimizations to make in the payload, but this RC is very representative of the final product. The RC introduces several new features: JSON Light The [&hellip;]<\/p>\n","protected":false},"author":512,"featured_media":3253,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[48,60,78],"class_list":["post-613","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-odata","tag-odata","tag-prerelease","tag-wcf-data-services"],"acf":[],"blog_post_summary":"<p>Today we are releasing refreshed NuGet packages as well as an installer for WCF Data Services 5.1.0-rc2. This RC is very close to complete. We do still have a few optimizations to make in the payload, but this RC is very representative of the final product. The RC introduces several new features: JSON Light The [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/posts\/613","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/users\/512"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/comments?post=613"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/posts\/613\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/media\/3253"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/media?parent=613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/categories?post=613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/tags?post=613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}