1 / 28

Liberate Your Apps!

Liberate Your Apps!. Philippe Leefsma Senior Developer Consultant Autodesk Developer Network . Getting Started. Windows Communication Foundation ( WCF ) http :// msdn.microsoft.com/en-us/library/ms731082.aspx Cloud Hosting Providers http://www.windowsazure.com http ://aws.amazon.com.

aelan
Download Presentation

Liberate Your Apps!

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Liberate Your Apps! Philippe LeefsmaSenior Developer Consultant Autodesk Developer Network

  2. Getting Started • Windows Communication Foundation (WCF) • http://msdn.microsoft.com/en-us/library/ms731082.aspx • Cloud Hosting Providers • http://www.windowsazure.com • http://aws.amazon.com

  3. WCF Web ServicesMigrate your Application logic to the cloud…

  4. What is WCF ? • Windows Communication Foundation is Microsoft's next-generation programming platform and runtime system for building, configuring and deploying network-distributed services (Source MSDN)

  5. WCF Unification

  6. WCF Basics - ABC • "ABC" is the key to understand how a WCF service is composed: • "A" stands for Address: Where is the service? • "B" stands for Binding: How do clients talk to the service? • "C" stands for Contract: What can the service do for a client?

  7. Data Contract [DataContract] publicclassAdnMaterial { [DataMember] publicstring Name { get; set; } [DataMember] publicdouble Price { get; set; } [DataMember] publicstring Manufacturer { get; set; } }

  8. Service Contract [ServiceContract] publicinterfaceIMaterialSrv { [OperationContract] AdnMaterial[] GetMaterials(); [OperationContract] AdnMaterialGetMaterial( stringmaterialName); [OperationContract] boolPostMaterial( AdnMaterialmaterial); }

  9. Implementing Services publicclassMaterialSrv : IMaterialSrv { publicMaterialSrv() { //Constructor... } publicAdnMaterial[] GetMaterials() { //Implementation... } //Implementation other methods... }

  10. Service bindings • A binding binds a service contract implementation to an address. This includes: • Choosing an appropriate transport protocol • Choosing how messages are encoded • Defining how security works

  11. Hosting a Service • The following options are available to host a WCF Service: • Self-hosting in any managed .NET application Winform, WPF, console Application, … • Hosting in a Windows service • Hosting in IIS ASP.Net Direct Hosting

  12. WCF Demo

  13. HTTP Requests • World Wide Web (WWW) • Web of resources • Resources reference each other • Resources can be of many types (e.g., documents, images, services, html pages) • URI identifies resources (Uniform Resource Identifier) • HTTP used to access resources 9 methods (a.k.a. verbs): GET, PUT , POST , DELETE , … HEAD, OPTIONS, TRACE, CONNECT, PATCH

  14. SOAP • SOAP stands for Simple Object Access Protocol • Protocol for exchanging structured information through Web Services • Relies on XML for its message format, and Application Layer protocols like HTTP or SMTP for message transmission

  15. REST • REST stands for Representational State Transfer • REST is an architectural style that exploits HTTP protocol • Provides an easier way of data access comparing with SOAP • Good solution for interoperability betweenweb servicesand mobile platforms or browsers

  16. REST Web Services Why REST? REST is a lightweight alternative to SOAP SOAP: <?xmlversion="1.0"?> <soap:Envelopexmlns:soap="http://www.w3.org/2003/12/soap-envelope">  <soap:Bodypb="http://www.adesk.com/memberdb">   <db:GetDeveloperDetails>    <db:DeveloperID>12345</db:DeveloperID>   </db:GetDeveloperDetails>  </soap:Body> </soap:Envelope> SOAP REST http://www.adesk.com/memberdb/DeveloperDetails/12345

  17. SOAP vs REST SOAP • Supports only GET and POST • All data is in the xml message Resource to access Function to execute REST • Uses all HTTP verbs: GET, POST, PUT, DELETE, … • Resource is identified by URI • Function is identified by the HTTP verb

  18. JSON • JSON (JavaScript Object Notation) is a lightweight data exchange format • JSON is a text format easy for humans to read and write and fast for machines to parse and generate • One of the most popular exchange format in web services at the moment

  19. JSON vs XML { "Manufacturer":"ADN", "Name":"Steel", "Price":"100.0" } <?xml version="1.0" encoding="UTF-8" ?> <Manufacturer>ADN</Manufacturer> <Name>Steel</Name> <Price>100.0</Price>

  20. Adding REST Support in WCF [ServiceContract] publicinterfaceIMaterialSrv { [OperationContract] [WebInvoke( Method = "GET", UriTemplate = "/Material/{materialName}", ResponseFormat = WebMessageFormat.Json)] AdnMaterialGetMaterial(stringmaterialName); [OperationContract] [WebInvoke( Method = "POST", UriTemplate = "/Material", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)] boolPostMaterial(AdnMaterialmaterial); }

  21. Deployment on the Cloud Azure Example illustrated…

  22. Step I - Azure project

  23. Step 2 - Package Creation

  24. Step 3 - Azure Deployment

  25. Step 4 - Test

  26. Getting Started with Android programming • Install Eclipse http://www.eclipse.org/downloads/ • Install Android SDK http://developer.android.com/sdk/installing.html • Get started with Android development http://developer.android.com/guide/index.html

  27. Getting Started with iOS programming • Install Xcode Downloadable from App Store Mac application Includes SDK and iOS Simulator • Get started with iOS development https://developer.apple.com/devcenter/ios/index.action

More Related