Welcome to MSDN Blogs Sign in | Join | Help

Cloud Computing for Developers

Alejandro Villanueva's Blog

News


  • Cloud Computing Blog Search


    Alejandro Villanueva
    Lead Developer Evangelist
    Microsoft®
    Latin America

















    MSDN Social Bookmark

    Add to Technorati Favorites




Archives

Atom Publishing Protocol (AtomPub) in the Live Platform

David Treadwell in his news and updates on the Live Platform Services, announced that Microsoft is unifying its developer platform protocols for services on the open, standards-based Atom format (RFC 4287) and the Atom Publishing Protocol (RFC 5023). Adopting the standardized Atom Publishing Protocol is in line with Microsoft's  new interoperability principles.

The Atom Publishing Protocol (AtomPub or APP) is a simple HTTP-based protocol for creating and updating web resources. AtomPub builds on top of the  Atom Syndication Format, an formalizes many of the mechanisms required for the exchange of rich and meaningful content via a process known as Representational State Transfer - REST.  

There are new Live services with AtomPub endpoints which enable any HTTP-aware application to easily consume Atom feeds of photos and for unstructured application storage. You can also use any Atom-aware public tools or libraries, such as .NET WCF Syndication to read or write these cloud service-based feeds.

AtomPub will also be supported in ADO.NET Data Services ("Project Astoria"). See Pablo Castro's post about APP support in Astoria.

Therefore, it's important to understand the fundamentals of Atom Publishing Protocol (AtomPub) if you want to leverage services offered by Microsoft on the Web. Many Web 2.0 sites as well, now implement AtomPub.

What is AtomPub?

An application-level protocol for publishing and editing Web resources using HTTP and XML.

The AtomPub Model

AtomPub operates on collections of Web resources. All collections and their resources support the same basic interactions. The interactions are based on the common HTTP verbs.

  • GET is used to retrieve a representation of a resource or perform a read-only query.
  • POST is used to create a new, dynamically-named resource.
  • PUT is used to update a known resource.
  • DELETE is used to remove a resource.

What can be done with AtomPub?

  • Ask the server for a list of available resources.
    • Collections “folders” or “directories”
    • Entries e.g. blogs or web pages
  • Request the server to perform CRUD (Create, Read, Update, Delete) operations.

Learn more about the Atom Publishing Protocol here

Build Social Networks with Windows Live Contacts

People can use their Windows Live contact information with your site, while keeping complete control of their data. This includes Hotmail, Messenger, and Mobile contacts.

You can build Social Networks using: 

  • Contacts API (Beta). A RESTful API that works on Address Book objects. It allows users to grant and revoke permission to their data on a site-by-site basis. The protocols to manage the permissioning process are provided by Windows Live ID Delegated Auth.
  • Contacts Control (Beta). This control allows users to sign in to Windows Live from your site and conduct a one-time transfer of contacts data. The control requires the user to select and approve contacts for transfer.
Windows Live Contacts API - Beta 1.0

This is an HTTP-based service that enables developers to programmatically submit queries to, and retrieve results from, the Windows Live Contacts Address Book database service.

Windows Live Contacts API provides :

  • Full contact management interface for a Windows Live user's address book
  • View to a subset of the Contact data for the purposes of sending Invitations.

The owner of the data controls each view and set of abilities.

The Windows Live Contacts Web service is exposed to clients in a HTTP/GET request interface with XML response.

Try out the Interactive SDK
Try out the Contacts Control (Beta)

About the Windows Live Contacts API

Contacts Control Mashups samples:

  • Crash a Party
  • Map Your Contacts
  • Basics of SQL Server Data Services (SSDS) Query Model
    In SQL Server Data Services (SSDS) an authority stores containers, and a container stores entities.

    When you query the service, you first choose the scope over which you wish to query, and then you provide a query expression to filter the flexible entities in the scope. The syntax that begins the query operation is (?q=). For example, to query for entities, specify a container scope, followed by the query expression: 

         https://{authority}.data.beta.mssds.com/v1/{container}?q={query}  

    You cannot retrieve entity objects today by searching at the authority level, the widest scope for any entity search is the Container. There is no cross-container search (in the current implementation).

    However, if you want to query for container metadata, specify an authority scope, followed by the query expression:

         https://<authority_id>.data.beta.mssds.com/v1/?q={query}

    The Query Language 

    The LINQ-like syntax of the query language that is supported in this release is as follows:

              from e in entities [where condition] select e

    The query iterates over the set of flexible entities in the specified scope and returns only those items that satisfy the specified condition in the optional where clause. In the where clause, you can specify a simple condition or a compound condition (multiple conditions combined by using logical operators). 

    The syntax allows you to distinguish between querying metadata (system) properties and querying flexible properties (anything you added). When you query metadata properties, you use the '.' notation. In the following query, the condition in the where clause references the Id metadata property. The query retrieves a Flexible Entity with a specific Id value.

              from e in entities where e.Id == "someId" select e

    The flexible properties are stored in the Properties collection of the entity. When you query over these properties, you specify the property name by using Indexer syntax. The following query retrieves all entities whose Age flexible property value is 32:

     
              from e in entities where e["Age"] == 32 select e
     
    You can tie together multiple expressions using the && (AND), || (OR), and ! (NOT) logical operators.  Precedence can be set using parentheses (). 
    4 New Quick Applications for the Windows Live Platform

    There are four new Quick Applications - Retail, Team Builder, Field Manager, and Contoso Riders - all of which offer community-based Web sites integrating Windows Live services. Quick Applications are fully customizable and developed around specific Web scenarios. Quick Apps are typically developed by Microsoft Partners or customers, and occasionally in-house.

    The source code has been released to Codeplex, which means anyone can download, modify, and resell the code (see MS-PL License for all the details).

    What are Quick Applications used for? Angus Logan writes in his blog that

    The Quick Apps have 3 purposes

    1. Examples of what is possible – use them, play with them, get ideas!
    2. Technical reference – if you want to use a Live Platform API, there is a good chance it will be in a Quick App, check out the code to see how it was implemented.
    3. Starting point – these end-to-end applications are licensed under a fairly liberal (OSI approved) license, you can use them as starting points for your own applications.

    Get the Quick Applications

    Retail (demo) Develop an e-commerce site that uses videos to display products.

    retail 

    Team Builder (demo) Develop a community around a group or team. Add photos, upload videos, and start conversations with other members.

    teambuilder 

    Field Manager (demo) Manage fields and leagues for sporting events. Create leagues, see up-to-date weather conditions for fields, add and view notes about field conditions.
    fieldmanager 

    Contoso Riders (demo) Allows members to create bike rides and events. Share photos, add interactive maps, chat with other riders, and upload videos.

    contosoriders 

     

    Virtual Earth ASP.NET Control (CTP Release)

    Finally, the CTP release of the new Virtual Earth ASP.NET control is available.

    ASP.NET developers can now integrate Microsoft Virtual Earth Maps simply by dragging and dropping an ASP.NET Server Control in Visual Studio and Visual Web Developer. No JavaScript programming is required. This control can be combined with ASP.NET AJAX capabilities to provide ASP.NET Serverside processing without the need of coding in JavaScript.

    The Map control is available right in your toolbox of Visual Studio

    clip_image001

    You can drag and drop the control from toolbox onto your web page and set some properties and you are ready to go.

    clip_image002 clip_image003

    clip_image004

    Server side events for panning/zooming, find/directions are available in addition to client side events for the map control.

    clip_image005 clip_image006

    You can control how map displays on your web page with standard functionality like MapMode (2D/3D), MapStyle(Road/Aerial), displaying dashboard and setting its size, setting the zoom levels, zooming in/out, panning etc.

    You can add shapes to map from ASP.NET Server Side using provided methods. You can query different shapes/layers in the Map and delete them as well.

    Downloads  

    The suite of tools is currently a community technology preview, we strongly discourage any web site from going live using these controls.

    This CTP release only targets English (United States).

    Requirements

    Operating System

    • Microsoft Windows XP SP 2 or
    • Microsoft Windows Vista

    Development Tools

     

    Windows Live Tools for Microsoft Visual Studio (CTP Release)

    I want to highlight the availability of the Windows Live™ Tools for Microsoft® Visual Studio® 2008, currently in the Community Technical Preview stage. 

    This set of control add-ins enable .NET developers to easily integrate Windows Live services into their Web applications, using Visual Studio 2008 and Visual Web Developer Express 2008.

     The six controls included in this CTP release are:

     Download the CTP of Windows Live Tools for Microsoft Visual Studio here

    This CTP release only targets English (United States).

    Requirements for Using Windows Live Tools

    Operating System

    • Microsoft Windows XP SP 2
    • Microsoft Windows Vista

    Development Tools

    Understanding the Data Model of SQL Server Data Services (SSDS)

    SSDS offers a simple, easy-to-understand data model. This post is an overview in order to get strated quickly. To learn more go to SQL Server Data Services Primer on MSDN.

    The SSDS data model is a three-level containment model that includes authorities, containers and entities.

    • Authority: At the top level of this containment hierarchy is an authority. After you sign up for the data service, you begin by creating an authority. An authority is represented by a DNS name. For example:mydomain.data.beta.mssds.com. Where mydomain is an authority and data.beta.mssds.com refers to the service. The DNS name of an authority resolves to an IP address that maps to a specific data center. An authority, then, is the unit of geo location.
    • Container: An authority is a collection of containers. Each container has a unique id within an authority. A container stores data (entities). You create a container and then immediately begin storing entities of various kinds without having to worry about any container schema. A container is also the largest domain for search and update. In this beta release, cross-container queries are not supported.
    • Entity: Each entity inside a container can store any number of user-defined properties and corresponding values. An entity is the smallest object that can be updated, that is, you can retrieve an entire entity; add, update, delete properties; and then replace the original entity with the updated one. Partial updates are not supported. Blobs in SSDS are entities. These blob entities can only have metadata properties.

    Depending on your application needs, you container can be a homogeneous or heterogeneous.

    • Homogeneous model: a container stores entities of the same kind. In this model, a container is like a table in a database. Some of the examples of homogeneous containers are as follows:
      • In an Employee table, you store employee records. These are all records of the same kind. In SSDS, you would create an Employee container that stores Employee entities. These entities can have different properties, but they are all Employee entities.
      • In a sample authority, books-docsamples (DNS name books-docsamples.data.beta.mssds.com), you can create containers such as ChildrensBooks and TechnicalBooks. You then store book entities in appropriate containers.
    • Heterogeneous model: a container is like a database that stores entities of all kinds. For example, a database can have Orders, Employees, and OrderDetails tables. In SSDS, you can create a single container to store orders, employees, and order details entities. The advantage in this case is that you can query across heterogeneous entities within the same container.

    In SQL Server Data Services, the flexible entity is a key concept.

    • Flexible entity: each of these entities is a set of metadata properties and a bag of flexible properties. You can think of flexible entities as sparse tables in the relational data model or an XML fragment with one element per property value. Each property has a name and a value. The value can only be a simple scalar type. The simple scalar types supported in this release are string, binary, Boolean, decimal, and datetime.
    • Metadata Properties: Each flexible entity carries a fixed set of properties (Id, Version, and Kind). A blob entity has additional Content property. These are called metadata properties. The Id property uniquely identifies a flexible entity. The Version property acts like a timestamp. The Kind property value is user-defined and identifies the entity type. The Content blob property describes the blob.
    • Flexible Properties: In addition to the metadata properties, an entity can also have zero or more additional flexible properties. These flexible properties can have any name and any scalar value of one of the above scalar types.

    NOTE In the current implementation, there are limits to using the user-defined and metadata properties.

    Service Interface: SSDS supports both the SOAP and REST interfaces.

    The URI Space: there are four kinds of URIs that you will work with if you are using the REST head.

    • Service: Used only during the authority creation process.
    • Authority: Used while creating and querying containers. In addition, the authority URI is used to retrieve metadata regarding a particular authority.
    • Container: Used while creating and querying entities. In addition, the container URI is used to retrieve metadata regarding a particular container or to delete a particular container.
    • Entity: Used while retrieving, updating, and deleting a particular entity.

    Examples:

    • Service URI used when creating an authority. In the URI, v1 refers to version of service interface to be used. For this beta release, the value of version must always be v1

              https://data.beta.mssds.com/v1/

    • An authority URI is the service URI preceded by the authority id.

              https://<authority_id>.data.beta.mssds.com/v1/

    • A container URI is the authority URI followed by a container id.

             https://<authority_id>.data.beta.mssds.com/v1/<container_id>

    The container URI fetches a single entity that conatins container metadata

    An entity URI is a container URI followed by entity id. It returns a specific entity. The result includes all the metadata properties (id, version, and kind) and any user-defined flexible properties.

             https://<authority_id>.data.beta.mssds.com/v1/<container_id>/<entity_id>

    A sample book entity is shown below:

    <UsedBookKind xmlns:s="http://schemas.microsoft.com/sitka/2008/03/"        
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                  xmlns:x="http://www.w3.org/2001/XMLSchema">
      <s:Id>MySampleBook</s:Id>
      <s:Version>1</s:Version>
      <Title xsi:type="x:string">My Book</Title>
      <ISBN xsi:type="x:string">1-57880-066-36</ISBN>
      <Author xsi:type="x:string">Mr. Author</Author>
      <Publisher xsi:type="x:string">Mr. Publisher</Publisher>
      <InPrint xsi:type="x:boolean">false</InPrint>
      <NumberOfCopiesSold xsi:type="x:decimal">250</NumberOfCopiesSold>
      <PublicationDate xsi:type="x:dateTime">2004-01-27T00:00:00</PublicationDate>
      <CoverPhoto xsi:type="x:base64Binary">AQID</CoverPhoto>
    </UsedBookKind>
     

     

    Page view tracker