Click to edit Master title style

idleheadedceleryMobile - Wireless

Dec 10, 2013 (3 years and 8 months ago)

69 views

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

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

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 Services


Migrate
your
Application logic



to the cloud…

Click to edit Master title style


Click to edit Master text styles


Second level


Third level


Fourth level

»
Fifth level

Autodesk Confidential Information

Autodesk Confidential Information

What is WCF ?


W
indows
C
ommunication
F
oundation
is
Microsoft's next
-
generation programming
platform and runtime system for building,
configuring and deploying network
-
distributed
services


(Source MSDN)

Click to edit Master title style


Click to edit Master text styles


Second level


Third level


Fourth level

»
Fifth level

Autodesk Confidential Information

Autodesk Confidential Information

WCF Unification

Click to edit Master title style


Click to edit Master text styles


Second level


Third level


Fourth level

»
Fifth level

Autodesk Confidential Information

Autodesk 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?


Click to edit Master title style


Click to edit Master text styles


Second level


Third level


Fourth level

»
Fifth level

Autodesk Confidential Information

Autodesk 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
;



}


}

Click to edit Master title style


Click to edit Master text styles


Second level


Third level


Fourth level

»
Fifth level

Autodesk Confidential Information

Autodesk Confidential Information

Service Contract





[
ServiceContract
]


public

interface

IMaterialSrv


{


[
OperationContract
]


AdnMaterial
[]
GetMaterials
();




[
OperationContract
]


AdnMaterial

GetMaterial
(



string

materialName
);




[
OperationContract
]


bool

PostMaterial
(



AdnMaterial

material);


}

Click to edit Master title style


Click to edit Master text styles


Second level


Third level


Fourth level

»
Fifth level

Autodesk Confidential Information

Autodesk Confidential Information

Implementing Services





public

class

MaterialSrv

:
IMaterialSrv


{


public

MaterialSrv
()


{



//
Constructor...




}




public

AdnMaterial
[]
GetMaterials
()


{


//Implementation...


}





//Implementation other
methods...


}

Click to edit Master title style


Click to edit Master text styles


Second level


Third level


Fourth level

»
Fifth level

Autodesk Confidential Information

Autodesk 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


Click to edit Master title style


Click to edit Master text styles


Second level


Third level


Fourth level

»
Fifth level

Autodesk Confidential Information

Autodesk Confidential Information

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


Click to edit Master title style


Click to edit Master text styles


Second level


Third level


Fourth level

»
Fifth level

Autodesk Confidential Information

Autodesk Confidential Information

WCF Demo

Click to edit Master title style


Click to edit Master text styles


Second level


Third level


Fourth level

»
Fifth level

Autodesk Confidential Information

Autodesk 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





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



P
rotocol for
exchanging structured
information
through Web
Services



R
elies
on
XML
for its message format, and
Application
Layer
protocols like
HTTP
or SMTP
for
message
transmission

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



P
rovides
an easier way of data access comparing
with
SOAP



G
ood solution
for interoperability
between

web
services

and mobile platforms or browsers


Click to edit Master title style


Click to edit Master text styles


Second level


Third level


Fourth level

»
Fifth level

Autodesk Confidential Information

Autodesk 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

Click to edit Master title style


Click to edit Master text styles


Second level


Third level


Fourth level

»
Fifth level

Autodesk Confidential Information

Autodesk Confidential Information

SOAP
vs

REST

SOAP



Supports only GET and POST


A
ll data is in the xml message

R
esource to access

F
unction to execute


REST



U
ses all HTTP verbs: GET, POST, PUT, DELETE, …


Resource is identified by URI


F
unction is identified by the HTTP verb

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


Click to edit Master title style


Click to edit Master text styles


Second level


Third level


Fourth level

»
Fifth level

Autodesk Confidential Information

Autodesk 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>

Click to edit Master title style


Click to edit Master text styles


Second level


Third level


Fourth level

»
Fifth level

Autodesk Confidential Information

Autodesk 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);


}

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 Cloud


Azure Example
illustrated…

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

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

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

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

Click to edit Master title style


Click to edit Master text styles


Second level


Third level


Fourth level

»
Fifth level

Autodesk Confidential Information

Autodesk Confidential Information

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




Click to edit Master title style


Click to edit Master text styles


Second level


Third level


Fourth level

»
Fifth level

Autodesk Confidential Information

Autodesk Confidential Information

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




Click to edit Master title style


Click to edit Master text styles


Second level


Third level


Fourth level

»
Fifth level

Autodesk Confidential Information

Autodesk Confidential Information