3. JSON
• Serialization format
• “JavaScript Object Notation”
• Concise, human-readable, interoperable
• No schema
XML
<vehicle
xmlns=“http://schemas.xyz.com/vehicles”>
<makeCode>audi</makeCode>
<modelCode>a3</modelCode>
</vehicle>
JSON
{
"modelCode":
"a3",
"makeCode":
"audi"
4. JSON: WHY SHOULD I CARE?
• Performance
• Interop (json.org)
• Ease of access
• Modernity
5. MICROSOFT AND JSON
• Available in WCF from Fx 3.5
• DataContractJsonSerializer
• WebHttpBinding
• First-class option in ASP.NET Web API
• MVC 4 & Fx 4.5
• 3rd party JSON.NET library
7. JSON IN .NET
• WCF Demo – Recap
• Explicit in service definition
• [WebGet(UriTemplate="makes", ResponseFormat=
WebMessageFormat.Json)]
• Hard to customise
11. JAVASCRIPT: WHY SHOULD I CARE?
• Rapid development/prototyping
• Widen API reach
• Single codebase for JS runtimes
• Web apps and mobile apps
• Inherently async
• Server-side applications
12. MICROSOFT AND JAVASCRIPT
• jQuery in ASP.NET + IntelliSense
• Knockout (MVVM), modernizr (HTML5)
• TypeScript
• Superset of JavaScript, adds type-safety, class &
interface definition
• Compiler generates pure JS
• Eases learning curve from .NET
• VS plugin (and Vim, Emacs) + WebEssentials
• Pre-dates ECMAScript 6
26. AMQP
• Advanced Messaging Queuing Protocol
• Interopable, standards-based wire protocol
• Fast, durable, scalable
• History & heavy usage in finance industry
• Industry adopters
• RabbitMQ - VMWare
• Apache Qpid
• Windows Azure Service Bus
27. AMQP: WHY SHOULD I CARE?
• Rich functionality & messaging patterns
• Interoperable MQ standard
• Ignore protocol, focus on message
• Multiple providers
• Choose your cloud (StormMQ…)
• BUT
• Few full AMQP providers
• And notable missing parties (SQS, ZeroMQ)
• How interoperable?
• Traction?
28. MICROSOFT AND AMQP
• v1.0 launch (2011)
• AMQP support for Azure Service Bus
• Queue, topic, subscription
• Limited client support…
Open VehicleService – WebGetCall makes-WCF in RESTClientShow XML versionOpen DiagnosticsServiceShow status-WCF with date & enum
Open VehicleService – WebGetCall makes-WCF in RESTClientShow XML versionOpen DiagnosticsServiceShow status-WCF with date & enum
Open VehicleController – WebApi overviewCall vehicle-API in RESTClientGet as XML with AcceptOpen DiagnosticsControllerShow status-WCF with date & enum, show formatting options in global.asax
Open VehicleController – WebApi overviewCall vehicle-API in RESTClientGet as XML with AcceptOpen DiagnosticsControllerShow status-WCF with date & enum, show formatting options in global.asax
1. Load ApiClient.ts2. TS constucts – module, export, class, “:” type3. Generates .js or .min.js on save - WebEssentials + TS plugin4. Show intellisense – var vehicle = client.get…
1. Load ApiClient.ts2. TS constucts – module, export, class, “:” type3. Generates .js or .min.js on save - WebEssentials + TS plugin4. Show intellisense – var vehicle = client.get…
Azure Portal -> MongoLabs portalShow collectionREST client – get & searchOpen VehiclesController; NuGet – installed packages, 10gen MongoGet Server – MongoLab, db – my db, collection – whateverStandard LINAOpen CachedVehicleModel – Mongo-specific wrapper
Open FormatService.js & walkthrough - imports, functions, HTTP serverRun FormatService.cmd & browse to Local – change input and show consoleOpen Azure console, show Web site & browse to Azure serviceBack to Mac, open TextWrangler & editOpen SourceTree, and commit – with push, show all – deployment text
Open FormatService.js & walkthrough - imports, functions, HTTP serverRun FormatService.cmd & browse to Local – change input and show consoleOpen Azure console, show Web site & browse to Azure serviceBack to Mac, open TextWrangler & editOpen SourceTree, and commit – with push, show all – deployment text
Open PasswordReset.js & walkthrough – connect to AMQP, create & bind queue, HTTP serverOpen RabbitMQmgmtStart PasswordReset.cmd & fire requestsRabbitMQmgmt – messages in queue, view messageOpen AmqpConsumerprogram.csStart AmqpConsumer & PaperCut – process messages; start x2 and submit more
Open PasswordReset.js & walkthrough – connect to AMQP, create & bind queue, HTTP serverOpen RabbitMQ mgmtStart PasswordReset.cmd & fire requestsRabbitMQ mgmt – messages in queue, view messageOpen AmqpConsumerprogram.csStart AmqpConsumer & PaperCut – process messages; start x2 and submit more
Moan – AMQP should interop, but notOpen AzurePasswordReset.js & walkthrough – connect to Azure, create queue, HTTP serverStart AzurePasswordReset.cmd & fire requestsAzure console – messages in queueOpen AzureConsumerprogram.csStart AzureConsumer & PaperCut – process messages; start x2 and submit more
Moan – AMQP should interop, but notOpen AzurePasswordReset.js & walkthrough – connect to Azure, create queue, HTTP serverStart AzurePasswordReset.cmd & fire requestsAzure console – messages in queueOpen AzureConsumerprogram.csStart AzureConsumer & PaperCut – process messages; start x2 and submit more