<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Mobility</title>
        <link>http://www.rickgaribay.net/category/63.aspx</link>
        <description>Mobility</description>
        <language>en-US</language>
        <copyright>Rick G. Garibay</copyright>
        <managingEditor>rickgaribay@hotmail.com</managingEditor>
        <generator>Subtext Version 1.9.5.176</generator>
        <item>
            <title>Visual Studio Live Washington, D.C. &amp;ndash; Xamarin + Azure Mobile Services</title>
            <link>http://rickgaribay.net/archive/2014/11/11/visual-studio-live-washington-d.c.-ndash-xamarin--azure-mobile.aspx</link>
            <description>&lt;p&gt;Long overdue, here are my slides from VS Live DC last month.&lt;/p&gt;  &lt;p&gt;I plan on getting my demos up on Gitbub and will update this post when I do. &lt;/p&gt;  &lt;p&gt;Secure, federated identity. A durable, reliable and scalable backend. Scalable messaging fabrics that unlock assets both in the cloud and behind the firewall. All of these are table stakes when delivering modern mobile enterprise applications. Whether you are building responsive web apps for devices or targeting iOS, Android, Windows Phone or Windows Store apps, as a mobile developer, you must focus on delivering a beautiful and functional user experience if you want your apps to be adopted. What if you could have all of this plus the power or Visual Studio 2013 and Windows Azure? Well, now you can! Instead of reinventing the wheel each and every time you need to target a new device platform, learn how Visual Studio 2013 and Xamarin allow you to target iOS, Android and Windows devices while promoting reuse of code assets across platforms. And when you're done with the front–end work and are ready to wire up your mobile app, come see how Microsoft Azure Mobile Services provides a simplified stack that tackles security, durability, reliability and modern messaging all with just a few lines of code. In this session, you'll learn how you can harness the power of Visual Studio 2013 with the flexibility of Xamarin and the power of Microsoft Azure Mobile Services to tackle all of your cross platform and back end chores quickly and easily so you can focus on what your users really care about.&lt;/p&gt;  &lt;br /&gt;  &lt;center&gt;  &lt;iframe height="400" marginheight="0" src="//www.slideshare.net/slideshow/embed_code/41431701" frameborder="0" width="476" marginwidth="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/center&gt;&lt;img src="http://rickgaribay.net/aggbug/374.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Rick G. Garibay</dc:creator>
            <guid>http://rickgaribay.net/archive/2014/11/11/visual-studio-live-washington-d.c.-ndash-xamarin--azure-mobile.aspx</guid>
            <pubDate>Wed, 12 Nov 2014 00:32:16 GMT</pubDate>
            <comments>http://rickgaribay.net/archive/2014/11/11/visual-studio-live-washington-d.c.-ndash-xamarin--azure-mobile.aspx#feedback</comments>
            <wfw:commentRss>http://rickgaribay.net/comments/commentRss/374.aspx</wfw:commentRss>
            <trackback:ping>http://rickgaribay.net/services/trackbacks/374.aspx</trackback:ping>
        </item>
        <item>
            <title>IoT, Mobility, Hybrid Cloud, ESB Oh My! A Closer Look at the Neudesic Gartner AADI Demo</title>
            <link>http://rickgaribay.net/archive/2013/12/21/iot-mobility-hybrid-cloud-esb-oh-my-a-closer-look.aspx</link>
            <description>&lt;p&gt;Earlier this week, my colleague &lt;a href="http://twitter.com/simonguest" target="_blank"&gt;@simonguest&lt;/a&gt; &lt;a href="http://simonguest.com/2013/12/12/ibeacon-demo-at-gartner-aadi/" target="_blank"&gt;posted a great summary&lt;/a&gt; of the demo he and I built together for the &lt;a href="http://www.gartner.com/technology/summits/na/applications/" target="_blank"&gt;Gartner AADI Summit&lt;/a&gt; in Las Vegas week before last.&lt;a href="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/image_8.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 5px 5px 5px 30px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" align="right" src="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/image_thumb_8.png" width="389" height="480" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;As Simon illustrates, the demo combined two areas we are thinking a lot about these days at Neudesic- enterprise mobility and Internet of Things. &lt;/p&gt;  &lt;p&gt;When we talk about enterprise mobility, we're not talking about mobile device management, governance or provisioning. Our focus is on unlocking the assets that live on premises, behind the firewall so that they are safely and securely exposed, composed and consumed by a variety of devices and composite business applications on the web.&lt;/p&gt;  &lt;p&gt;In this post, I’ll talk a little bit more about these two areas and dive into the back-end of the demo from a messaging and services perspective to give you a glimpse into the internals of the demo app.   &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;Exposing On-Premise Assets&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The key unlocking event for enterprise mobility is enabling the ability to expose assets that live within an organization’s traditional datacenter. These assets include things like other apps, LOB systems, ERPs and databases. In the most traditional sense, the way this problem has been solved is by determining what assets need to be made available, standing up hardware on a DMZ and specifying which inbound ports allow which kind of traffic. Unfortunately, there’s really nothing too innovative about this approach as it is the way we’ve been solving this problem for nearly 20 years. &lt;/p&gt;  &lt;p&gt;Today, there are many enterprise mobility vendors out there offering an appliance based offering which extends this approach to address things like security, hardware compression, etc., but the agility of these solutions is questionable as they still required CapEx spend, time and resources to provision and manage. &lt;/p&gt;  &lt;p&gt;Another kind of on-premise asset you will be hearing more and more about involves sensors and devices that communicate with software and other devices. This Machine to Machine (M2M) communication will be revolutionary in domain&lt;a href="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/image.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="image" border="0" alt="image" align="left" src="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/image_thumb.png" width="191" height="93" /&gt;&lt;/a&gt;s such as transportation, retail, logistics, oil and gas, manufacturing, etc. as they will enable the ability to yield new insights that will at first transform business and then become key to survival. One such device is known as iBeacon.&lt;/p&gt;  &lt;p&gt;These devices, about the width and half the length of a stick of gum run on Bluetooth Low Energy (BLE) and thus require very little power. These beacons transmit a unique identifier along with signal strength which can then be used to calculate proximity. &lt;/p&gt;  &lt;p&gt;You can easily imagine a scenario where a retailer provides a free app that interacts with you in the store as you approach these iBeacons. As you might imagine, the back end of the app would learn your behaviors and preferences and target you with interesting offers to influence your browsing and buying habits as well as crowd sourcing what ideal retail layouts look like based on the tons of data that could be collected and modeled. Another scenario might involve tracking shipping containers on trucks. Today, 5.9 RFID technology dominates this space but the amount of infrastructure required to read the tags compared to what can be accomplished with a handful of iBeacons and a handheld device is disruptive indeed. To illustrate this in our demo, our iBeacons communicated directly with iOS and Android handsets, with literally no set up or tear down, allowing us to enumerate, update and “check into” the beacons that were placed throughout the conference floor. &lt;/p&gt;  &lt;p&gt;For the check in scenario, as you approached an iBeacon, the app would raise an event allowing you to check in to that location. The app then sent a message over the Gartner guest conference WIFI network to a server hosted in our datacenter in Irvine, CA running &lt;a href="http://products.neudesic.com/features" target="_blank"&gt;Neuron ESB&lt;/a&gt;. The server sits behind our firewall and no inbound ports are open because our IT policy rightfully prohibits it. Instead, a single outbound port is opened by Neuron over an Azure Service Bus Relay which allows for secure, bi-directional messaging for a number of APIs that we implemented which I’ll cover in more detail next.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;Composing and Consuming&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;As you can see in the demo sample architecture, we exposed a REST head over Azure Service Bus which provided the external messaging fabric for communicating with the apps running on iOS and Android in the Gartner exhibition hall. Using Neuron’s messaging and processing capabilities, we implemented the following 4 APIs:&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="882"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="424"&gt;         &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;          &lt;ul&gt;           &lt;li&gt;&lt;strong&gt;REGISTER BEACON&lt;/strong&gt;               &lt;br /&gt;PUT /beacons               &lt;br /&gt;{ id: "&amp;lt;&amp;lt;GUID&amp;gt;&amp;gt;", name: "Neudesic Booth, Expo Hall"} &lt;/li&gt;         &lt;/ul&gt;          &lt;p&gt; &lt;/p&gt;          &lt;p&gt;           &lt;br /&gt;&lt;/p&gt;          &lt;ul&gt;           &lt;li&gt;&lt;strong&gt;LOOK UP BEACON&lt;/strong&gt;               &lt;br /&gt;GET /beacons               &lt;br /&gt;[{ id: "&amp;lt;&amp;lt;GUID&amp;gt;&amp;gt;", name: "Beacon name"}, {id: "&amp;lt;&amp;lt;GUID&amp;gt;&amp;gt;", name: "Beacon name"}] (Array) &lt;/li&gt;         &lt;/ul&gt;          &lt;p&gt; &lt;/p&gt;          &lt;p&gt;           &lt;br /&gt;&lt;/p&gt;          &lt;ul&gt;           &lt;li&gt;&lt;strong&gt;GET ALL BEACONS&lt;/strong&gt;               &lt;br /&gt;GET /beacons/:id               &lt;br /&gt;{ id: "&amp;lt;&amp;lt;GUID&amp;gt;&amp;gt;", name: "Beacon name"} &lt;/li&gt;         &lt;/ul&gt;          &lt;p&gt; &lt;/p&gt;          &lt;p&gt;           &lt;br /&gt;&lt;/p&gt;          &lt;ul&gt;           &lt;li&gt;&lt;strong&gt;CHECK IN TO BEACON&lt;/strong&gt;               &lt;br /&gt;PUT /beacons/:id/checkin               &lt;br /&gt;{ userid: "&amp;lt;&amp;lt;facebookid&amp;gt;&amp;gt;" } &lt;/li&gt;         &lt;/ul&gt;          &lt;p&gt;&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="456"&gt;&lt;a href="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/image_3.png"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/image_thumb_3.png" width="251" height="480" /&gt;&lt;/a&gt;           &lt;br /&gt;&lt;font size="1"&gt;The Android version of the app the weekend before the conference. We used Xamarin to build a consistent UX for iOS as well. The iBeacons were re-registered with the actual locations of the booths on the conference floor within a few seconds. &lt;/font&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;To create a connection to Azure Service Bus, we simply created a Client Connector within a Service Endpoint in Neuron as shown below:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/image_4.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/image_thumb_4.png" width="617" height="414" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Neuron hosts an instance of the WCF NetMessagingBinding and creates a virtual service endpoint using the URI shown above. &lt;/p&gt;  &lt;p&gt;In order to route the requests from the app to the right logic, we implemented a simple controller called “Beacon Router” using a Neuron Process. Using a Decision step, we added 4 branches for each API:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/image_5.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/image_thumb_5.png" width="441" height="480" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Each Decision Step has a condition which returns true or false. If the condition returns true, the steps within the branch are executed. If not, the Process evaluates each branch until a match is found our returns a 404, Resource not Found. &lt;/p&gt;  &lt;p&gt;Here is a look at the the Check In Condition:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/image_6.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/image_thumb_6.png" width="640" height="422" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;As you can see, we used a simple UriTemplate to define the template for the Check In API. The URI is stored in the ESB message context within the MessageHeader.To property. If the template matches the actual URI, we return true and the steps within the branch execute in sequence. &lt;/p&gt;  &lt;p&gt;The next step that fires is the Publish step. We included this step for testing purposes to serve as Wire Tap on the messages that reach the branch. In this case, this was useful for inspecting the message off the wire by configuring a subscribing party and using our Neuron Test Client to inspect the message:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/image_7.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/image_thumb_7.png" width="568" height="480" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;This little trick aside, the Publish step is very powerful in that it allows you to asynchronously publish a message on a topic for other subscribers to pick up. Think of Scatter Gather as a good example. &lt;/p&gt;  &lt;p&gt;The next step you’ll notice is a Call Process step. This step simply allows you to call a nested Process which is helpful in factoring your Process (note that we could have chosen to asynchronously execute a nested process by wrapping it inside a Parallel step).&lt;/p&gt;  &lt;p&gt;The Check In process starts with a Push step. This step stores the current message for later use. &lt;/p&gt;  &lt;p&gt;This was required because we needed to first determine if the iBeacon location was valid before allowing a check in. The way Neuron Processes work is that the message is modified by each step allowing for very powerful enrichment and transformation of the message. However, since there can only be one message in context at any time, the current message is overwritten by the message we crafted up for the ODBC step which follows. &lt;/p&gt;  &lt;p&gt;In this case, we used the ODBC step to query SQL Server for the iBeacon guid. The ODBC step expects a message that conforms to it’s interface, a simple XML syntax for defining the query:&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre style="width: 73%; height: 20px" class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;string&lt;/span&gt; sql = String.Empty; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt; &lt;a href="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/SNAGHTMLd1870c0.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="SNAGHTMLd1870c0" border="0" alt="SNAGHTMLd1870c0" align="right" src="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/SNAGHTMLd1870c0_thumb.png" width="352" height="1234" /&gt;&lt;/a&gt;&lt;/pre&gt;

  &lt;pre style="width: 73%; height: 20px" class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;sql += &lt;span class="str"&gt;"&amp;lt;Statement type=\"Text\" sql=\"SELECT * FROM [dbo].[Beacon] WHERE BeaconGuid =?\"&amp;gt;"&lt;/span&gt;; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;sql += &lt;span class="str"&gt;"&amp;lt;Parameters&amp;gt;"&lt;/span&gt;; &lt;/pre&gt;

  &lt;pre style="width: 73%; height: 20px" class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;sql += &lt;span class="str"&gt;"&amp;lt;Parameter type=\"varchar\" name=\"@BeaconGuid\" value=\""&lt;/span&gt; + beaconId + &lt;span class="str"&gt;"\"/&amp;gt;"&lt;/span&gt;; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;sql += &lt;span class="str"&gt;"&amp;lt;/Parameters&amp;gt;"&lt;/span&gt;; &lt;/pre&gt;

  &lt;pre style="width: 73%; height: 20px" class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;sql += &lt;span class="str"&gt;"&amp;lt;/Statement&amp;gt;"&lt;/span&gt;; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre style="width: 73%; height: 20px" class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;context.Data.FromXml(sql);&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[













.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Note line 9 above replaces the message in the context with this new message. The ODBC step executes the query based on the latest context and returns the result:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;QueryResults&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; 
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;QueryResult&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; 
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Id&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;2&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Id&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; 
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;BeaconGuid&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;1.1&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;BeaconGuid&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; 
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;BeaconName&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Neudesic Booth&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;BeaconName&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; 
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;QueryResults&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; 
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;QueryResult&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[













.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Next, we used a Decision step to check to see if the ODBC step yielded the iBeacon we looked up:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre style="width: 73%; height: 20px" class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;var xml = context.Data.ToXmlDocument(); &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;var node = xml.GetElementsByTagName(&lt;span class="str"&gt;"QueryResult"&lt;/span&gt;); &lt;/pre&gt;

  &lt;pre style="width: 73%; height: 20px" class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;&lt;span class="kwrd"&gt;return&lt;/span&gt; node.Count &amp;gt; 0;&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[












.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;p&gt;If the node count is not zero, we know we have a match. Otherwise, we issue a 404 since the resource could not be found. &lt;/p&gt;

&lt;p&gt;Recall that at the beginning of the process execution, the first thing we did was push the message into temporary storage so that we could retrieve it later. Once we determined that the iBeacon exists, we pop the message back into context so that we can grab the iBeacon id from the URI and the user id of the user (in this case, a facebook email address) from the original HTTP message body.&lt;/p&gt;

&lt;p&gt;To perform the chec kin, we simply did an INSERT into a SQL Server table called CheckIn. The Code step includes the following code, which as before, the ODBC step will consume and perform the unit of work. &lt;/p&gt;

&lt;p&gt;Since the iBeacon ID is part of the URI, we use UriTemplate again to determine a match and then extract the {id} parameter from the URI:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre style="width: 73%; height: 20px" class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;System.UriTemplate template = &lt;span class="kwrd"&gt;new&lt;/span&gt; System.UriTemplate(&lt;span class="str"&gt;"/beacons/{id}/checkin"&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;Uri uri = &lt;span class="kwrd"&gt;new&lt;/span&gt; Uri(context.Data.GetProperty(&lt;span class="str"&gt;"MessageHeader"&lt;/span&gt;,&lt;span class="str"&gt;"To"&lt;/span&gt;));&lt;/pre&gt;

  &lt;pre style="width: 73%; height: 20px" class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;Uri baseUri = &lt;span class="kwrd"&gt;new&lt;/span&gt; Uri(&lt;span class="str"&gt;"https://"&lt;/span&gt; + uri.Host);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;var match = template.Match(baseUri, uri);&lt;/pre&gt;

  &lt;pre style="width: 73%; height: 20px" class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;var beaconId = match.RelativePathSegments[1];&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[





.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;p&gt;From there, we do some formatting and grab the user id from the JSON message payload that was provided in the HTTP body: &lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre style="width: 73%; height: 20px" class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;System.Web.Script.Serialization.JavaScriptSerializer serializer = &lt;span class="kwrd"&gt;new&lt;/span&gt; System.Web.Script.Serialization.JavaScriptSerializer();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre style="width: 73%; height: 20px" class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;Neudesic.TPG.GartnerAADI.Model.CheckIn checkIn = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;System.Web.Script.Serialization.JavaScriptSerializer().Deserialize&amp;lt;Neudesic.TPG.GartnerAADI.Model.CheckIn&amp;gt;(jsonString);&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[




.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;p&gt;Finally, we build the INSERT statement and load the new message context: &lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre style="width: 73%; height: 20px" class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;string&lt;/span&gt; sql = String.Empty;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre style="width: 73%; height: 20px" class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;sql += &lt;span class="str"&gt;"&amp;lt;Statement type=\"Text\" sql=\"INSERT INTO [dbo].[CheckIn]([UserId],[BeaconGuid],[Date]) VALUES(?,?,?)\"&amp;gt;"&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;sql += &lt;span class="str"&gt;"&amp;lt;Parameters&amp;gt;"&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre style="width: 73%; height: 20px" class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;sql += &lt;span class="str"&gt;"&amp;lt;Parameter type=\"varchar\" name=\"@UserId\" value=\""&lt;/span&gt; + checkIn.UserId + &lt;span class="str"&gt;"\"/&amp;gt;"&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;sql += &lt;span class="str"&gt;"&amp;lt;Parameter type=\"varchar\" name=\"@BeaconGuid\" value=\""&lt;/span&gt; + beaconId + &lt;span class="str"&gt;"\"/&amp;gt;"&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre style="width: 73%; height: 20px" class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;sql += &lt;span class="str"&gt;"&amp;lt;Parameter type=\"varchar\" name=\"@Date\" value=\""&lt;/span&gt; + DateTime.Now.ToString() + &lt;span class="str"&gt;"\"/&amp;gt;"&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;sql += &lt;span class="str"&gt;"&amp;lt;/Parameters&amp;gt;"&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre style="width: 73%; height: 20px" class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;sql += &lt;span class="str"&gt;"&amp;lt;/Statement&amp;gt;"&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre style="width: 73%; height: 20px" class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;context.Data.FromXml(sql);&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[



.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;p&gt;If all goes well, we issue an HTTP 200 back to the client: &lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre style="width: 73%; height: 20px" class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;context.Data.Http = &lt;span class="kwrd"&gt;new&lt;/span&gt; HttpMessage();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;context.Data.Http.StatusCode = System.Net.HttpStatusCode.OK;&lt;/pre&gt;

  &lt;pre style="width: 73%; height: 20px" class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;context.Data.FromString(&lt;span class="str"&gt;""&lt;/span&gt;);&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[


.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;p&gt;Otherwise we own up to the problem being on our end and return a 500 (with some internal logging of course). &lt;/p&gt;

&lt;p&gt;The Register API is implemented in much the same way. We check to see if the iBeacon exists and if so, do an update, otherwise insert a new record. Thus, this API supports initial standing up of the beacons as well as managing the names as the beacons moved from development to the expo floor. &lt;/p&gt;

&lt;p&gt;For the GET APIs, we again used ODBC steps to query for a single or all beacons and returned a single or an array of beacons respectively as you can see in the BeaconRouter screenshot at the beginning of this walkthrough. &lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;As you can probably guess, Simon and I had a lot of fun building this demo and the folks at the conference seemed to find it interesting too :-) &lt;/p&gt;

&lt;p&gt;There are unlimited possibilities once you unlock the ability to safely and securely transcend network, security and business boundaries behind the firewall. And if agility isn’t enough to compel you to think differently about how you expose and compose your enterprise assets for external consumption by mobile devices today, the proliferation of devices- and I’m not talking about tablets or phones- expected to reach in the excess of 250 billion by 2025, will challenge every industry to think differently about their enterprise messaging and mobility strategy. &lt;/p&gt;&lt;img src="http://rickgaribay.net/aggbug/362.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Rick G. Garibay</dc:creator>
            <guid>http://rickgaribay.net/archive/2013/12/21/iot-mobility-hybrid-cloud-esb-oh-my-a-closer-look.aspx</guid>
            <pubDate>Sat, 21 Dec 2013 15:49:41 GMT</pubDate>
            <comments>http://rickgaribay.net/archive/2013/12/21/iot-mobility-hybrid-cloud-esb-oh-my-a-closer-look.aspx#feedback</comments>
            <wfw:commentRss>http://rickgaribay.net/comments/commentRss/362.aspx</wfw:commentRss>
            <trackback:ping>http://rickgaribay.net/services/trackbacks/362.aspx</trackback:ping>
        </item>
    </channel>
</rss>