28
Click to edit Master title style • Click to edit Master text styles – Second level • Third level – Fourth level » Fifth level Autodesk Confidential Information Liberate Your Apps! Philippe Leefsma Senior Developer Consultant Autodesk Developer Network

Liberate Your Apps!

  • Upload
    aelan

  • View
    28

  • Download
    0

Embed Size (px)

DESCRIPTION

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. - PowerPoint PPT Presentation

Citation preview

Page 1: Liberate  Your Apps!

Click to edit Master title style

• Click to edit Master text styles– Second level• Third level

– Fourth level» Fifth level

Autodesk Confidential Information

Liberate Your Apps!

Philippe LeefsmaSenior Developer Consultant

Autodesk Developer Network

Page 2: Liberate  Your Apps!

Click to edit Master title style

• Click to edit Master text styles– Second level• Third level

– Fourth level» Fifth level

Autodesk Confidential Information

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

Page 3: Liberate  Your Apps!

Click to edit Master title style

• Click to edit Master text styles– Second level• Third level

– Fourth level» Fifth level

Autodesk Confidential Information

WCF Web ServicesMigrate your Application logic

to the cloud…

Page 4: Liberate  Your Apps!

Click to edit Master title style

• Click to edit Master text styles– Second level• Third level

– Fourth level» Fifth level

Autodesk Confidential InformationAutodesk Confidential Information

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)

Page 5: Liberate  Your Apps!

Click to edit Master title style

• Click to edit Master text styles– Second level• Third level

– Fourth level» Fifth level

Autodesk Confidential InformationAutodesk Confidential Information

WCF Unification

Page 6: Liberate  Your Apps!

Click to edit Master title style

• Click to edit Master text styles– Second level• Third level

– Fourth level» Fifth level

Autodesk Confidential InformationAutodesk Confidential Information

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?

Page 7: Liberate  Your Apps!

Click to edit Master title style

• Click to edit Master text styles– Second level• Third level

– Fourth level» Fifth level

Autodesk Confidential InformationAutodesk Confidential Information

Data Contract [DataContract] public class AdnMaterial {  [DataMember] public string Name { get; set; }  [DataMember] public double Price { get; set; }  [DataMember] public string Manufacturer { get; set; } }

Page 8: Liberate  Your Apps!

Click to edit Master title style

• Click to edit Master text styles– Second level• Third level

– Fourth level» Fifth level

Autodesk Confidential InformationAutodesk Confidential Information

Service Contract [ServiceContract] public interface IMaterialSrv { [OperationContract] AdnMaterial[] GetMaterials();  [OperationContract] AdnMaterial GetMaterial( string materialName);  [OperationContract] bool PostMaterial( AdnMaterial material); }

Page 9: Liberate  Your Apps!

Click to edit Master title style

• Click to edit Master text styles– Second level• Third level

– Fourth level» Fifth level

Autodesk Confidential InformationAutodesk Confidential Information

Implementing Services

public class MaterialSrv : IMaterialSrv { public MaterialSrv() { //Constructor... }

 

public AdnMaterial[] GetMaterials() { //Implementation... } 

//Implementation other methods... }

Page 10: Liberate  Your Apps!

Click to edit Master title style

• Click to edit Master text styles– Second level• Third level

– Fourth level» Fifth level

Autodesk Confidential InformationAutodesk Confidential Information

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

Page 11: Liberate  Your Apps!

Click to edit Master title style

• Click to edit Master text styles– Second level• Third level

– Fourth level» Fifth level

Autodesk Confidential InformationAutodesk Confidential Information

Hosting a Service

The following options are available to host a WCF Service:

Self-hosting in any managed .NET applicationWinform, WPF, console Application, …

Hosting in a Windows service

Hosting in IISASP.NetDirect Hosting

Page 12: Liberate  Your Apps!

Click to edit Master title style

• Click to edit Master text styles– Second level• Third level

– Fourth level» Fifth level

Autodesk Confidential InformationAutodesk Confidential Information

WCF Demo

Page 13: Liberate  Your Apps!

Click to edit Master title style

• Click to edit Master text styles– Second level• Third level

– Fourth level» Fifth level

Autodesk Confidential InformationAutodesk Confidential Information

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

Author
modified title
Page 14: Liberate  Your Apps!

Click to edit Master title style

• Click to edit Master text styles– Second level• Third level

– Fourth level» Fifth level

Autodesk Confidential Information

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

Page 15: Liberate  Your Apps!

Click to edit Master title style

• Click to edit Master text styles– Second level• Third level

– Fourth level» Fifth level

Autodesk Confidential Information

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 between web services and mobile platforms or browsers

Page 16: Liberate  Your Apps!

Click to edit Master title style

• Click to edit Master text styles– Second level• Third level

– Fourth level» Fifth level

Autodesk Confidential InformationAutodesk Confidential Information

REST Web Services Why REST?

REST is a lightweight alternative to SOAP

SOAP:

SOAP

REST

<?xml version="1.0"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/12/soap-envelope"> <soap:Body pb="http://www.adesk.com/memberdb">  <db:GetDeveloperDetails>   <db:DeveloperID>12345</db:DeveloperID>  </db:GetDeveloperDetails> </soap:Body></soap:Envelope>

http://www.adesk.com/memberdb/DeveloperDetails/12345

Page 17: Liberate  Your Apps!

Click to edit Master title style

• Click to edit Master text styles– Second level• Third level

– Fourth level» Fifth level

Autodesk Confidential InformationAutodesk Confidential Information

SOAP vs RESTSOAP

Supports only GET and POSTAll data is in the xml message

Resource to accessFunction to execute

REST

Uses all HTTP verbs: GET, POST, PUT, DELETE, …Resource is identified by URIFunction is identified by the HTTP verb

Page 18: Liberate  Your Apps!

Click to edit Master title style

• Click to edit Master text styles– Second level• Third level

– Fourth level» Fifth level

Autodesk Confidential Information

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

Page 19: Liberate  Your Apps!

Click to edit Master title style

• Click to edit Master text styles– Second level• Third level

– Fourth level» Fifth level

Autodesk Confidential InformationAutodesk Confidential Information

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>

Page 20: Liberate  Your Apps!

Click to edit Master title style

• Click to edit Master text styles– Second level• Third level

– Fourth level» Fifth level

Autodesk Confidential InformationAutodesk Confidential Information

Adding REST Support in WCF [ServiceContract] public interface IMaterialSrv { [OperationContract] [WebInvoke( Method = "GET", UriTemplate = "/Material/{materialName}", ResponseFormat = WebMessageFormat.Json)] AdnMaterial GetMaterial(string materialName);  [OperationContract] [WebInvoke( Method = "POST", UriTemplate = "/Material", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)] bool PostMaterial(AdnMaterial material); }

Page 21: Liberate  Your Apps!

Click to edit Master title style

• Click to edit Master text styles– Second level• Third level

– Fourth level» Fifth level

Autodesk Confidential Information

Deployment on the CloudAzure Example illustrated…

Page 22: Liberate  Your Apps!

Click to edit Master title style

• Click to edit Master text styles– Second level• Third level

– Fourth level» Fifth level

Autodesk Confidential Information

Step I - Azure project

Page 23: Liberate  Your Apps!

Click to edit Master title style

• Click to edit Master text styles– Second level• Third level

– Fourth level» Fifth level

Autodesk Confidential Information

Step 2 - Package Creation

Page 24: Liberate  Your Apps!

Click to edit Master title style

• Click to edit Master text styles– Second level• Third level

– Fourth level» Fifth level

Autodesk Confidential Information

Step 3 - Azure Deployment

Page 25: Liberate  Your Apps!

Click to edit Master title style

• Click to edit Master text styles– Second level• Third level

– Fourth level» Fifth level

Autodesk Confidential Information

Step 4 - Test

Page 26: Liberate  Your Apps!

Click to edit Master title style

• Click to edit Master text styles– Second level• Third level

– Fourth level» Fifth level

Autodesk Confidential InformationAutodesk Confidential Information

Getting Started with Android programming

Install Eclipse http://www.eclipse.org/downloads/

Install Android SDKhttp://developer.android.com/sdk/installing.html

Get started with Android developmenthttp://developer.android.com/guide/index.html

Page 27: Liberate  Your Apps!

Click to edit Master title style

• Click to edit Master text styles– Second level• Third level

– Fourth level» Fifth level

Autodesk Confidential InformationAutodesk Confidential Information

Getting Started with iOS programming

Install Xcode Downloadable from App Store Mac application

Includes SDK and iOS Simulator

Get started with iOS developmenthttps://developer.apple.com/devcenter/ios/index.action

Page 28: Liberate  Your Apps!

Click to edit Master title style

• Click to edit Master text styles– Second level• Third level

– Fourth level» Fifth level

Autodesk Confidential InformationAutodesk Confidential Information