Ambient(Compu-ng(/(Web(of(Things(/(
ENS(Mines(Saint/E-enne(
Andrei(Ciortea(
“Web(Intelligence”(Master(–(December(2013(
2(
Andrei'Ciortea'PhD(Student(
ISCOD / LSTI
The White City of R’Landri
"Web(Intelligence"(Master,(December(2013(
3("Web(Intelligence"(Master,(December(2013(
M.(Weiser.(The(Computer(for(the(21st(Century,(1991(
Xerox(PARC,(1991'
4("Web(Intelligence"(Master,(December(2013(
M.(Weiser.(The(Computer(for(the(21st(Century,(1991(
Xerox(PARC,(1991'
5("Web(Intelligence"(Master,(December(2013(
M.(Weiser.(The(Computer(for(the(21st(Century,(1991(
Xerox(PARC,(1991'
• tabs(• pads(• boards(
6("Web(Intelligence"(Master,(December(2013(
M.(Weiser.(The(Computer(for(the(21st(Century,(1991(
Xerox(PARC,(1991'
ubiquitous'compu5ng'(ubicomp)'
• tabs(• pads(• boards(
“The(most(profound(technologies(are(those(that(disappear.(They(weave(themselves(into(the(fabric(of(everyday(life(un-l(they(are(indis-nguishable(from(it.”(
"Web(Intelligence"(Master,(December(2013( 7(
Fast/forward(to(2013…(
"Web(Intelligence"(Master,(December(2013( 8(
(Good'Night'Lamp,'2013)'h\p://www.vimeo.com/56586373(
"Web(Intelligence"(Master,(December(2013( 9(
Fast/forward(to(2013…(
"Web(Intelligence"(Master,(December(2013( 10(
Integra5ng(func-onality(across(smart&things:(
"Web(Intelligence"(Master,(December(2013( 11(
(Philips,(2012)(
An(augmented'reality(app(for(shaving(app(
Integra5ng(func-onality(across(smart&things:(
"Web(Intelligence"(Master,(December(2013( 12(
(Philips,(2012)(
Smart(things(already(provide(interes-ng(func-onality(by(themselves…(
An(augmented'reality(app(for(shaving(app(
Integra5ng(func-onality(across(smart&things:(
"Web(Intelligence"(Master,(December(2013( 13(
(Philips,(2012)(
Smart(things(already(provide(interes-ng(func-onality(by(themselves…(
…(but(integra-ng(func-onality(across(smart(things(opens(up(a(world(of(new(possibili-es!(
An(augmented'reality(app(for(shaving(app(
Integra5ng(func-onality(across(smart&things:(
"Web(Intelligence"(Master,(December(2013( 14(
(Ericsson,'The'Social'Web'of'Things,'2011)'h\p://www.vimeo.com/22022800(
Challenge:((
"Web(Intelligence"(Master,(December(2013( 15(
How(to(create(a(loosely'coupled(ecosystem(of(services(for(smart&things?(
Challenge:((
"Web(Intelligence"(Master,(December(2013( 16(
How(can(the(Web(help?(
How(to(create(a(loosely'coupled(ecosystem(of(services(for(smart&things?(
• Introduc-on(• Web(Services(
– WS/*(Web(Services(– RESTful(Web(Services(
• RESTifying(Things(• Service(Integra-on(in(the(WoT(• The(Social(Web(of(Things(
17(
Outline(
"Web(Intelligence"(Master,(December(2013( "Web(Intelligence"(Master,(December(2013( 18(
WWW(Virtual(Library,(h\p://www.vlib.us(
Key(Takeaways(
• What(is(the(WoT(• What(is(REST(• How(to(RESTify(things(• Current(challenges(in(the(WoT(
"Web(Intelligence"(Master,(December(2013( 19(
• Introduc5on'• Web(Services(
– WS/*(Web(Services(– RESTful(Web(Services(
• RESTifying(Things(• Service(Integra-on(in(the(WoT(• The(Social(Web(of(Things(
20(
Outline(
"Web(Intelligence"(Master,(December(2013(
Introduc-on(Internet'of'Things'(IoT)'–(one(term,(many(visions(
"Web(Intelligence"(Master,(December(2013( 21(
L.(Atzori,(A.(Iera,(and(G.(Morabito.(The(Internet(of(Things:(A(Survey,(2010.(
Introduc-on(Internet'of'Things'(IoT)'–(one(term,(many(visions(
"Web(Intelligence"(Master,(December(2013( 22(
“Things(have(iden--es(and(virtual(personali-es(opera-ng(in(smart(spaces(using(intelligent(interfaces(to(connect(and(communicate(within(social,(environmental,(and(user(contexts.”(
INFSO(D.4(Networked(Enterprise(&(RFID(INFSO(G.2(Micro(&(Nanosystems,(Working(Group(RFID(of(the(ETP(EPOSS.(Internet(of(Things(in(2020,(Roadmap(for(the(Future,(2008.(
L.(Atzori,(A.(Iera,(and(G.(Morabito.(The(Internet(of(Things:(A(Survey,(2010.(
Introduc-on(Internet'of'Things'(IoT)'–(one(term,(many(visions(
"Web(Intelligence"(Master,(December(2013( 23(
“Things(have(iden--es(and(virtual(personali-es(opera-ng(in(smart(spaces(using(intelligent(interfaces(to(connect(and(communicate(within(social,(environmental,(and(user(contexts.”(
INFSO(D.4(Networked(Enterprise(&(RFID(INFSO(G.2(Micro(&(Nanosystems,(Working(Group(RFID(of(the(ETP(EPOSS.(Internet(of(Things(in(2020,(Roadmap(for(the(Future,(2008.(
(“The(Internet(of(Things(allows(people(and(things(to(be(connected(Any-me,(Anyplace,(with(Anything(and(Anyone,(ideally(using(Any(path/network(and(Any(service.”(
P.(Guillemin(and(P.(Friess.(Internet(of(Things(strategic(research(roadmap,(2009.(
L.(Atzori,(A.(Iera,(and(G.(Morabito.(The(Internet(of(Things:(A(Survey,(2010.(
Introduc-on(Internet'of'Things'(IoT)'–(one(term,(many(visions(
"Web(Intelligence"(Master,(December(2013( 24(
“Things(have(iden--es(and(virtual(personali-es(opera-ng(in(smart(spaces(using(intelligent(interfaces(to(connect(and(communicate(within(social,(environmental,(and(user(contexts.”(
INFSO(D.4(Networked(Enterprise(&(RFID(INFSO(G.2(Micro(&(Nanosystems,(Working(Group(RFID(of(the(ETP(EPOSS.(Internet(of(Things(in(2020,(Roadmap(for(the(Future,(2008.(
(“The(Internet(of(Things(allows(people(and(things(to(be(connected(Any-me,(Anyplace,(with(Anything(and(Anyone,(ideally(using(Any(path/network(and(Any(service.”(
P.(Guillemin(and(P.(Friess.(Internet(of(Things(strategic(research(roadmap,(2009.((“The(IoT(integrates(a(large(number(of(technologies(and(envisions(a(variety(of(things(or(objects(around(us(that,(through(unique(addressing(schemes(and(standard(communica-on(protocols,(are(able(to(interact(with(each(other(and(cooperate(with(their(neighbors(to(reach(common(goals.”(
L.(Atzori,(A.(Iera,(G.(Morabito,(and(M.(Nim.(The(Social(Internet(of(Things(–(When(social(networks(meet(the(Internet(of(Things:(Concept,(architecture(and(network(characteriza-on,(2012.(
L.(Atzori,(A.(Iera,(and(G.(Morabito.(The(Internet(of(Things:(A(Survey,(2010.(
Introduc-on(
"Web(Intelligence"(Master,(December(2013( 25(
“The(IoT(does(not(revolu-onize(our(lives(or(the(field(of(compu-ng.(It(is(another(step(in(the(evolu-on(of(the(Internet(we(already(have.”(
C.(Petera,(A.(Zaslavsky,(P.(Christen,(and(D.(Georgakopoulous.(Context(Aware(Compu-ng(for(the(Internet(of(Things:(A(Survey,(2013.(
Internet'of'Things'(IoT)'–(one(term,(many(visions(
Introduc-on(
"Web(Intelligence"(Master,(December(2013( 26(
“The(IoT(does(not(revolu-onize(our(lives(or(the(field(of(compu-ng.(It(is(another(step(in(the(evolu-on(of(the(Internet(we(already(have.”(
C.(Petera,(A.(Zaslavsky,(P.(Christen,(and(D.(Georgakopoulous.(Context(Aware(Compu-ng(for(the(Internet(of(Things:(A(Survey,(2013.(
Internet'of'Things'(IoT)'–(one(term,(many(visions(
Introduc-on(
"Web(Intelligence"(Master,(December(2013( 27(
(Philips,(2012)(
• InternetIenabled(programmable'mirror,(capable(of(displaying(data(in(a(given(format.(
• InternetIenabled(programmable'electric'razor,(capable(of(collec-ng(usage(data.(
• Task:(Build(an(augmented(reality(shaving(applica-on(that(displays(on(the(mirror(some(data(collected(by(the(electric(razor.(
Introduc-on(
"Web(Intelligence"(Master,(December(2013( 28(
(Philips,(2012)(
• InternetIenabled(programmable'mirror,(capable(of(displaying(data(in(a(given(format.(
• InternetIenabled(programmable'electric'razor,(capable(of(collec-ng(usage(data.(
• Task:(Build(an(augmented(reality(shaving(applica-on(that(displays(on(the(mirror(some(data(collected(by(the(electric(razor.(
PlaMormIindependence:(what(if(there(are(several(manufacturers?(
Introduc-on(
"Web(Intelligence"(Master,(December(2013( 29(
(Philips,(2012)(
• InternetIenabled(programmable'mirror,(capable(of(displaying(data(in(a(given(format.(
• InternetIenabled(programmable'electric'razor,(capable(of(collec-ng(usage(data.(
• Task:(Build(an(augmented(reality(shaving(applica-on(that(displays(on(the(mirror(some(data(collected(by(the(electric(razor.(
PlaMormIindependence:(what(if(there(are(several(manufacturers?(
Rapid'prototyping:(do(I(need(to(get(familiar(with(each(plaqorm?(
Introduc-on(RealIworld'case'study(–(developing(Glassware:(
"Web(Intelligence"(Master,(December(2013( 30(
Introduc-on(RealIworld'case'study(–(developing(Glassware:(
"Web(Intelligence"(Master,(December(2013( 31(
• Web/based(apps,(using(the(Mirror'API'
"Web(Intelligence"(Master,(December(2013( 32(
h\p://developers.google.com/glass/develop/(
"Web(Intelligence"(Master,(December(2013( 33(
h\p://developers.google.com/glass/develop/(
"Web(Intelligence"(Master,(December(2013( 34(
h\p://developers.google.com/glass/develop/(
"Web(Intelligence"(Master,(December(2013( 35(
h\p://developers.google.com/glass/develop/(
Introduc-on(RealIworld'case'study(–(developing(Glassware:(
"Web(Intelligence"(Master,(December(2013( 36(
• Web/based(apps,(using(the(Mirror'API:(• Plaqorm(independence(• Common(infrastructure(• Easy(integra-on(with(exis-ng(Web(apps(• Low(entry(barrier(for(developers(
Introduc-on(RealIworld'case'study(–(developing(Glassware:(
"Web(Intelligence"(Master,(December(2013( 37(
• Web/based(apps,(using(the(Mirror'API:(• Plaqorm(independence(• Common(infrastructure(• Easy(integra-on(with(exis-ng(Web(apps(• Low(entry(barrier(for(developers(
• na-ve(apps,(using(the(GDK((Glass(Development(Kit):(• Real/-me(user(interac-on(• Offline(func-onality(• Access(to(hardware(• Solid(background(in(Android(is(required(
Introduc-on(RealIworld'case'study(–(developing(Glassware:(
"Web(Intelligence"(Master,(December(2013( 38(
• Web/based(apps,(using(the(Mirror'API:(• Plaqorm(independence(• Common(infrastructure(• Easy(integra-on(with(exis-ng(Web(apps(• Low(entry(barrier(for(developers(
• na-ve(apps,(using(the(GDK((Glass(Development(Kit):(• Real/-me(user(interac-on(• Offline(func-onality(• Access(to(hardware(• Solid(background(in(Android(is(required(
• or(using(both.(
Introduc-on(
"Web(Intelligence"(Master,(December(2013( 39(
Challenge:(( How(to(create(a(loosely'coupled(ecosystem(of(
services(for(smart&things?(
Introduc-on(
"Web(Intelligence"(Master,(December(2013( 40(
We(need(a(protocol(that(is(simple,(lightweight,(looselyIcoupled,(scalable,(flexible(and((hopefully)(standard.(
Challenge:(( How(to(create(a(loosely'coupled(ecosystem(of(
services(for(smart&things?(
Material(adapted(from:(V.(Trifa(and(D.(Guinard.(Web(of(Things(–(Connec-ng(People(and(Objects(on(the(Web,(SXSW,(2010.(
Introduc-on(
"Web(Intelligence"(Master,(December(2013( 41(
We(need(a(protocol(that(is(simple,(lightweight,(looselyIcoupled,(scalable,(flexible(and((hopefully)(standard.(
Challenge:(( How(to(create(a(loosely'coupled(ecosystem(of(
services(for(smart&things?(
How(about(the(Web?(
Material(adapted(from:(V.(Trifa(and(D.(Guinard.(Web(of(Things(–(Connec-ng(People(and(Objects(on(the(Web,(SXSW,(2010.(
Introduc-on(
"Web(Intelligence"(Master,(December(2013( 42(
Web'of'Things'(WoT)(Ubiquitous(Web,(Dave(Ragge\,(2007(
Introduc-on(
"Web(Intelligence"(Master,(December(2013( 43(
Web'of'Things'(WoT)(
“The(emerging(Web(of(Things(is(a(concrete(implementa-on(of(the(Internet(of(Things(vision(that(focuses(on(establishing(applica-on/level(connec-vity(between(heterogeneous(devices.”((
S.(Mayer(and(G.(Basler.(Seman-c(metadata(to(support(device(interac-on(in(smart(environments,(2013.(
Ubiquitous(Web,(Dave(Ragge\,(2007(
Introduc-on(
"Web(Intelligence"(Master,(December(2013( 44(
Web'of'Things'(WoT)(
“In(the(Web(of(Things,(we(are(considering(smart(things(as(first/class(ci-zens(of(the(Web(and(posi-on(the(WoT(as(a(refinement(of(the(IoT(by(integra-ng(smart(things(not(only(into(the(Internet((the(network),(but(into(the(Web((the(applica-on(layer).”(
“The(emerging(Web(of(Things(is(a(concrete(implementa-on(of(the(Internet(of(Things(vision(that(focuses(on(establishing(applica-on/level(connec-vity(between(heterogeneous(devices.”((
S.(Mayer(and(G.(Basler.(Seman-c(metadata(to(support(device(interac-on(in(smart(environments,(2013.(
D.(Guinard.(A(Web(of(Things(Applica-on(Architecture(–(Integra-ng(the(Real/World(into(the(Web,(2011.(
Ubiquitous(Web,(Dave(Ragge\,(2007(
Introduc-on(
"Web(Intelligence"(Master,(December(2013( 45(
Web'of'Things'(WoT)(
“In(the(Web(of(Things,(we(are(considering(smart(things(as(first/class(ci-zens(of(the(Web(and(posi-on(the(WoT(as(a(refinement(of(the(IoT(by(integra-ng(smart(things(not(only(into(the(Internet((the(network),(but(into(the(Web((the(applica-on(layer).”(
Using(the(Web(as(an(applica-on(architecture,(and(not(as(a(transporta-on(layer.(
“The(emerging(Web(of(Things(is(a(concrete(implementa-on(of(the(Internet(of(Things(vision(that(focuses(on(establishing(applica-on/level(connec-vity(between(heterogeneous(devices.”((
S.(Mayer(and(G.(Basler.(Seman-c(metadata(to(support(device(interac-on(in(smart(environments,(2013.(
D.(Guinard.(A(Web(of(Things(Applica-on(Architecture(–(Integra-ng(the(Real/World(into(the(Web,(2011.(
Ubiquitous(Web,(Dave(Ragge\,(2007(
Introduc-on(
"Web(Intelligence"(Master,(December(2013( 46(
Two(types(of(Web(services(stand(out(as(poten-al(candidates:(
• WS/*(Web(services(• RESTful(Web(services(
D.(Guinard,(I.(Ion,(and(S.(Mayer.(In(search(of(an(Internet(of(Things(Service(Architecture:(REST(or(WS/*?(A(developers’(perspec-ve,(2012.(
Challenge:(( How(to(create(a(loosely'coupled(ecosystem(of(
services(for(smart&things?(
• Introduc-on(• Web'Services'
– WSI*'Web'Services'– RESTful(Web(Services(
• RESTifying(Things(• Service(Integra-on(in(the(WoT(• The(Social(Web(of(Things(
47(
Outline(
"Web(Intelligence"(Master,(December(2013(
WS/*(Web(Services(
A(serviceIoriented'architecture(– An(endpoint(is(an(ac-on,(in(the(form(of(a(service'call:(
• e.g.,(h\p://emse.fr/room104/getTemperature(
"Web(Intelligence"(Master,(December(2013( 48(
WS/*(Web(Services(
A(serviceIoriented'architecture(– An(endpoint(is(an(ac-on,(in(the(form(of(a(service'call:(
• e.g.,(h\p://emse.fr/room104/getTemperature(
(What(is(the(WSI*'stack?(
– WS/Addressing,(WS/Discovery,(WS/Federa-on,(etc.(
"Web(Intelligence"(Master,(December(2013( 49( "Web(Intelligence"(Master,(December(2013( 50(
h\p://www1.innoq.com/resources/ws/standards/poster/(
WS/*(Web(Services(
• SOAP((used(to(be(Simple&Object&Access&Protocol)(– a(protocol(for(accessing(Web(services((service(access).(
• WSDL((Web(Services(Descrip-on(Language)(– a(language(for(describing(Web(services(and(how(to(access(them(
(service(descrip-on).'
• UDDI((Universal(Descrip-on,(Discovery(and(Integra-on)(– a(plaqorm/independent,(XML/based,(distributed(repository((service(
discovery).(
"Web(Intelligence"(Master,(December(2013( 51(
WS/*(Web(Services(
"Web(Intelligence"(Master,(December(2013( 52(
Material(adapted(from:(S.(Mayer.(Service(integra-on(in(the(Web(of(Things,(École(d’Éte(Web(Intelligence(2013(–(Web(des(Objets,(2013.(
SOAP(
"Web(Intelligence"(Master,(December(2013( 53(
• SOAP((used(to(be(Simple&Object&Access&Protocol)(– is(an(XML(language(that(defines(a(format(for(messages;(– is(plaqorm(and(language(independent;(– mul-ple(transport(protocols:(HTTP,(SMTP,(TCP,(etc.(
SOAP(
"Web(Intelligence"(Master,(December(2013( 54(
SOAP(envelope(
header((op-onal)(
body(
fault((op-onal)(
Applica-on/specific(informa-on((e.g.,(the(context(of(a(transac-on)(
Error(messages(
• SOAP((used(to(be(Simple&Object&Access&Protocol)(– is(an(XML(language(that(defines(a(format(for(messages;(– is(plaqorm(and(language(independent;(– mul-ple(transport(protocols:(HTTP,(SMTP,(TCP,(etc.(
SOAP:(A(Sample(Request(
"Web(Intelligence"(Master,(December(2013( 55(
POST /InStock HTTP/1.1 Host: www.example.org Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> <soap:Body xmlns:m="http://www.example.org/stock"> <m:GetStockPrice> <m:StockName>IBM</m:StockName> </m:GetStockPrice> </soap:Body> </soap:Envelope>
h\p://www.w3schools.com/webservices/ws_soap_body.asp(
SOAP:(A(Sample(Request(
"Web(Intelligence"(Master,(December(2013( 56(
POST /InStock HTTP/1.1 Host: www.example.org Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> <soap:Body xmlns:m="http://www.example.org/stock"> <m:GetStockPrice> <m:StockName>IBM</m:StockName> </m:GetStockPrice> </soap:Body> </soap:Envelope>
h\p://www.w3schools.com/webservices/ws_soap_body.asp(
SOAP:(A(Sample(Request(
"Web(Intelligence"(Master,(December(2013( 57(
POST /InStock HTTP/1.1 Host: www.example.org Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> <soap:Body xmlns:m="http://www.example.org/stock"> <m:GetStockPrice> <m:StockName>IBM</m:StockName> </m:GetStockPrice> </soap:Body> </soap:Envelope>
h\p://www.w3schools.com/webservices/ws_soap_body.asp(
SOAP:(A(Sample(Request(
"Web(Intelligence"(Master,(December(2013( 58(
POST /InStock HTTP/1.1 Host: www.example.org Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> <soap:Body xmlns:m="http://www.example.org/stock"> <m:GetStockPrice> <m:StockName>IBM</m:StockName> </m:GetStockPrice> </soap:Body> </soap:Envelope>
h\p://www.w3schools.com/webservices/ws_soap_body.asp(
SOAP:(A(Sample(Response(
"Web(Intelligence"(Master,(December(2013( 59(
HTTP/1.1 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> <soap:Body xmlns:m="http://www.example.org/stock"> <m:GetStockPriceResponse> <m:Price>34.5</m:Price> </m:GetStockPriceResponse> </soap:Body> </soap:Envelope>
h\p://www.w3schools.com/webservices/ws_soap_body.asp(
WSDL(
• WSDL((Web(Services(Descrip-on(Language)(– is(an(XML(language(for(describing(interfaces(syntac-cally:(
• func-on(signatures;(• service(binding((URL(and(protocol).(
– WSDL(documents(are(stored(in(repositories((e.g.,(UDDI).(
"Web(Intelligence"(Master,(December(2013( 60(
WSDL(
"Web(Intelligence"(Master,(December(2013( 61(
WSDL(defini-on(
types(
portType(
binding(
service(
• WSDL((Web(Services(Descrip-on(Language)(
messages(
What(does(the(exchanged(data(look(like?(
What(are(messages(composed(of?(
What(do(the(opera-ons(look(like?(
Which(protocol(to(use?(
Structure/Bundling(of(opera-ons.(
Material(adapted(from:(S.(Mayer.(Service(integra-on(in(the(Web(of(Things,(École(d’Éte(Web(Intelligence(2013(–(Web(des(Objets,(2013.(
WSDL:(HelloService(<defini-ons(name="HelloService"((((targetNamespace="h\p://www.examples.com/wsdl/HelloService.wsdl"((((xmlns="h\p://schemas.xmlsoap.org/wsdl/"((((xmlns:soap="h\p://schemas.xmlsoap.org/wsdl/soap/"((((xmlns:tns="h\p://www.examples.com/wsdl/HelloService.wsdl"((((xmlns:xsd="h\p://www.w3.org/2001/XMLSchema">((((((<message(name="SayHelloRequest">(((((((<part(name="firstName"(type="xsd:string"/>((((</message>((((<message(name="SayHelloResponse">(((((((<part(name="gree-ng"(type="xsd:string"/>((((</message>(((((<portType(name="Hello_PortType">(((((((<opera-on(name="sayHello">((((((((((<input(message="tns:SayHelloRequest"/>((((((((((<output(message="tns:SayHelloResponse"/>(((((((</opera-on>((((</portType>(((((<binding(name="Hello_Binding"(type="tns:Hello_PortType">((((<soap:binding(style="rpc"(((((((transport="h\p://schemas.xmlsoap.org/soap/h\p"/>(
(((<opera-on(name="sayHello">(((((((<soap:opera-on(soapAc-on="sayHello"/>(((((((<input>((((((((((<soap:body(((((((((((((encodingStyle="h\p://schemas.xmlsoap.org/soap/encoding/"(((((((((((((namespace="urn:examples:helloservice"(((((((((((((use="encoded"/>(((((((</input>(((((((<output>((((((((((<soap:body(((((((((((((encodingStyle="h\p://schemas.xmlsoap.org/soap/encoding/"(((((((((((((namespace="urn:examples:helloservice"(((((((((((((use="encoded"/>(((((((</output>((((</opera-on>((((</binding>(((((<service(name="Hello_Service">(((((((<documenta-on>WSDL(File(for(HelloService</documenta-on>(((((((<port(binding="tns:Hello_Binding"(name="Hello_Port">((((((((((<soap:address(((((((((((((loca-on="h\p://www.examples.com/SayHello/">(((((((</port>((((</service>(</defini-ons>(
"Web(Intelligence"(Master,(December(2013( 62(h\p://www.tutorialspoint.com/wsdl/wsdl_example.htm(
WS/*(in(Prac-ce(
• Stubs(handle(communica-on(issues,(such(as(message'packing'and'unpacking'(“marshalling”)'
• The(server(stub(is(also(responsible(for(publishing(the(WSDL'document'
• Crea-ng(stubs:(– Bo\om/up((code/first):(stub'from'implementa5on(
(JAX/WS)(– Top/down((contract/first):(stub'from'WSDL'
"Web(Intelligence"(Master,(December(2013( 63(
Material(adapted(from:(S.(Mayer.(Service(integra-on(in(the(Web(of(Things,(École(d’Éte(Web(Intelligence(2013(–(Web(des(Objets,(2013.(
WS/*(Discussion(
• Extremely(powerful(and(lots(of(available(tools(– Huge(complexity(
• WSDL(is(quite(verbose(for(simple(func-onality(
• SOAP(over(HTTP(uses(only(POST(– Therefore,(no(HTTP/based(caching(is(possible(
"Web(Intelligence"(Master,(December(2013( 64(
Material(adapted(from:(S.(Mayer.(Service(integra-on(in(the(Web(of(Things,(École(d’Éte(Web(Intelligence(2013(–(Web(des(Objets,(2013.(
• Introduc-on(• Web(Services(
– WS/*(Web(Services(– RESTful'Web'Services'
• RESTifying(Things(• Service(Integra-on(in(the(WoT(• The(Social(Web(of(Things(
65(
Outline(
"Web(Intelligence"(Master,(December(2013(
RESTful(Web(Services(• REST'(REpresenta-onal(State(Transfer)(
– was(coined(by(Roy'Fielding(in(his(PhD(thesis((2000).(– is(an(architectural(style(for(distributed(hypermedia(systems.(
"Web(Intelligence"(Master,(December(2013( 66(
RESTful(Web(Services(• REST'(REpresenta-onal(State(Transfer)(
– was(coined(by(Roy'Fielding(in(his(PhD(thesis((2000).(– is(an(architectural(style(for(distributed(hypermedia(systems.(
"Web(Intelligence"(Master,(December(2013( 67(
a(named,(coordinated(set(of(architectural(constraints(
RESTful(Web(Services(• REST'(REpresenta-onal(State(Transfer)(
– was(coined(by(Roy'Fielding(in(his(PhD(thesis((2000).(– is(an(architectural(style(for(distributed(hypermedia(systems.(
"Web(Intelligence"(Master,(December(2013( 68(
a(named,(coordinated(set(of(architectural(constraints(
non/linear(medium(of(informa-on((first(used(in(1965(by(Ted(Nelson)(
RESTful(Web(Services(• REST'(REpresenta-onal(State(Transfer)(
– was(coined(by(Roy'Fielding(in(his(PhD(thesis((2000).(– is(an(architectural(style(for(distributed(hypermedia(systems.(
"Web(Intelligence"(Master,(December(2013( 69(
a(named,(coordinated(set(of(architectural(constraints(
non/linear(medium(of(informa-on((first(used(in(1965(by(Ted(Nelson)(
“REST(emphasizes(scalability(of(component(interac-ons,(generality(of(interfaces,(the(independent(deployment(of(components(as(well(as(intermediary(components(to(reduce(interac-on(latency,(enforce(security,(and(encapsulate(legacy(systems.”(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
RESTful(Web(Services(• REST'(REpresenta-onal(State(Transfer)(
– was(coined(by(Roy'Fielding(in(his(PhD(thesis((2000).(– is(an(architectural(style(for(distributed(hypermedia(systems.(
"Web(Intelligence"(Master,(December(2013( 70(
RESTful(Web(Services(• REST'(REpresenta-onal(State(Transfer)(
– was(coined(by(Roy'Fielding(in(his(PhD(thesis((2000).(– is(an(architectural(style(for(distributed(hypermedia(systems.(
– is(a(dis7lla7on(of(the(Web(and(was(applied(to(design(HTTP(1.1(and(Uniform(Resource(Iden-fiers((URI).(
"Web(Intelligence"(Master,(December(2013( 71(
RESTful(Web(Services(• REST'(REpresenta-onal(State(Transfer)(
– was(coined(by(Roy'Fielding(in(his(PhD(thesis((2000).(– is(an(architectural(style(for(distributed(hypermedia(systems.(
– is(a(dis7lla7on(of(the(Web(and(was(applied(to(design(HTTP(1.1(and(Uniform(Resource(Iden-fiers((URI).(
– is(independent(of(the(Web.(
"Web(Intelligence"(Master,(December(2013( 72(
RESTful(Web(Services(• REST'(REpresenta-onal(State(Transfer)(
– was(coined(by(Roy'Fielding(in(his(PhD(thesis((2000).(– is(an(architectural(style(for(distributed(hypermedia(systems.(
– is(a(dis7lla7on(of(the(Web(and(was(applied(to(design(HTTP(1.1(and(Uniform(Resource(Iden-fiers((URI).(
– is(independent(of(the(Web.(• An(applica-on(conforming(to(the(REST(constraints(is(
characterized(as(being(RESTful.(
"Web(Intelligence"(Master,(December(2013( 73(
RESTful(Web(Services(• REST'(REpresenta-onal(State(Transfer)(
– was(coined(by(Roy'Fielding(in(his(PhD(thesis((2000).(– is(an(architectural(style(for(distributed(hypermedia(systems.(
– is(a(dis7lla7on(of(the(Web(and(was(applied(to(design(HTTP(1.1(and(Uniform(Resource(Iden-fiers((URI).(
– is(independent(of(the(Web.(• An(applica-on(conforming(to(the(REST(constraints(is(
characterized(as(being(RESTful.(• REST'is'simple,'but'full'of'subtle5es!'
"Web(Intelligence"(Master,(December(2013( 74(
REST(in(a(Nutshell(A(resourceIoriented(architecture(
• Everything(is(a(resource,(iden-fied(through(a(URI.(– An(endpoint(is(a(resource,(e.g.(h\p://emse.fr/room104/temperature(
• Everything(has(a(uniform(interface,(with(well(defined(interac-on(seman-cs.(
• Messages(are(self/descrip-ve.(• Hypermedia(drives(the(applica-on(state.(
– HATEOAS((Hypermedia(As(The(Engine(Of(Applica-on(State)(
• Interac-ons(are(stateless.(– No(client(state(can(be(stored(on(a(server(between(interac-ons.(
"Web(Intelligence"(Master,(December(2013( 75(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(For(an(interes-ng(summariza-on(of(Roy’s(thesis,(check(out:(h\p://wwatson.me/2011/10/01/rest/disserta-on/overview/part/1/(
(please(note:(it(might(be(the(personal(interpreta-on(of(the(blogger)(
Deriving(REST(
• Two(common(perspec-ves(on(the(process(of(architectural(design:(– start(from(scratch(and(build/up(an(architecture(from(familiar(
components(un-l(it(sa-sfies(the(needs(of(the(intended(system;(– start(with(the(system(needs(as(a(whole,(without(constraints,(and(then(
incrementally(iden-fy(and(apply(constraints(to(elements(of(the(system.(
"Web(Intelligence"(Master,(December(2013( 76(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
Deriving(REST(
• Two(common(perspec-ves(on(the(process(of(architectural(design:(– start(from(scratch(and(build/up(an(architecture(from(familiar(
components(un-l(it(sa-sfies(the(needs(of(the(intended(system;(– start(with(the(system(needs(as(a(whole,(without(constraints,(and(then(
incrementally(iden-fy(and(apply(constraints(to(elements(of(the(system.(
"Web(Intelligence"(Master,(December(2013( 77(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
Deriving(REST(
• Two(common(perspec-ves(on(the(process(of(architectural(design:(– start(from(scratch(and(build/up(an(architecture(from(familiar(
components(un-l(it(sa-sfies(the(needs(of(the(intended(system;(– start(with(the(system(needs(as(a(whole,(without(constraints,(and(then(
incrementally(iden-fy(and(apply(constraints(to(elements(of(the(system.(
"Web(Intelligence"(Master,(December(2013( 78(
WWW(
Null(style(R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
Deriving(REST(
• REST(constraints:(– Client/Server(– Stateless(– Cacheable(– Uniform(Interface(– Layered(System(– Code/On/Demand((op-onal)(
"Web(Intelligence"(Master,(December(2013( 79(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
Client/Server(• A(client(component(that(sends(requests,(and(a(server(that(receives(
requests(and(may(also(issue(a(response(to(the(client.(
• Design(principle:(separa5on'of'concerns.(• Induced(proper-es:(
– portability,(e.g.,(separa-ng(the(user(interface(concerns((client)(from(the(data(storage(concerns((server);(
– scalability,(server(components(are(simplified;(
– components(can(evolve(independently((developed,(replaced,(etc.).(
"Web(Intelligence"(Master,(December(2013( 80(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
Client/Server(• A(client(component(that(sends(requests,(and(a(server(that(receives(
requests(and(may(also(issue(a(response(to(the(client.(
• Design(principle:(separa5on'of'concerns.(• Induced(proper-es:(
– portability,(e.g.,(separa-ng(the(user(interface(concerns((client)(from(the(data(storage(concerns((server);(
– scalability,(server(components(are(simplified;(
– components(can(evolve(independently((developed,(replaced,(etc.).(
"Web(Intelligence"(Master,(December(2013( 81(
WWW(
Null(style(R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
Client/Server(• A(client(component(that(sends(requests,(and(a(server(that(receives(
requests(and(may(also(issue(a(response(to(the(client.(
• Design(principle:(separa5on'of'concerns.(• Induced(proper-es:(
– portability,(e.g.,(separa-ng(the(user(interface(concerns((client)(from(the(data(storage(concerns((server);(
– scalability,(server(components(are(simplified;(
– components(can(evolve(independently((developed,(replaced,(etc.).(
"Web(Intelligence"(Master,(December(2013( 82(
Client/Server(R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
Stateless(
• The(client/server(interac-on(is(selfIcontained.(
"Web(Intelligence"(Master,(December(2013( 83(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
Stateless(
• The(client/server(interac-on(is(selfIcontained.(
(
"Web(Intelligence"(Master,(December(2013( 84(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
no(contextual(informa-on(is(needed(for(interpre-ng(the(request((e.g.(no(sessions(or(transac-ons)(
Stateless(
• The(client/server(interac-on(is(selfIcontained.(
(
– Session(state(is(held(in(the(client.(
"Web(Intelligence"(Master,(December(2013( 85(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
no(contextual(informa-on(is(needed(for(interpre-ng(the(request((e.g.(no(sessions(or(transac-ons)(
Stateless(
• The(client/server(interac-on(is(selfIcontained.(
(
– Session(state(is(held(in(the(client.(– There(may(be(state(involved(and(the(server(can(transfer(the(session(
state(to(a(different(service((e.g.(a(database,(for(persis-ng(a(state(over(a(period(of(-me),(but(the(client/server(interac-on(itself(is(stateless.(
"Web(Intelligence"(Master,(December(2013( 86(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
no(contextual(informa-on(is(needed(for(interpre-ng(the(request((e.g.(no(sessions(or(transac-ons)(
Stateless(
• The(client/server(interac-on(is(selfIcontained.(
"Web(Intelligence"(Master,(December(2013( 87(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
Stateless(
"Web(Intelligence"(Master,(December(2013( 88(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
• The(client/server(interac-on(is(selfIcontained.(• Induced(proper-es:(
– visibility,(a(monitoring(system(does(not(have(to(look(beyond(a(single(request(to(understand(the(request;(
– reliability,(easier(to(recover(interac-on(from(par-al(failures;(
– scalability,(servers(don’t(have(to(manage(resources(across(requests.(
• Tradeoff:(– decrease(in(network(performance((repe--ve(data(across(requests);(– the(server(does(not(have(direct(control(on(the(applica-on(behavior.(
Stateless(
"Web(Intelligence"(Master,(December(2013( 89(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
Client/Server(
Stateless(
"Web(Intelligence"(Master,(December(2013( 90(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
Client/Stateless/Server(
Cacheable(
• Data(within(a(response(to(a(request(must(be(implicitly(or(explicitly(labeled(as(cacheable.(
• Induced(proper-es:(– improved(efficiency,(scalability(and(userIperceived'performance,(through(par-ally(or(completely(elimina-ng(some(interac-ons((reduced(average(latency(for(a(series(of(interac-ons).(
• Tradeoff:(– reliability(may(be(decreased(due(to(stale(data.(
"Web(Intelligence"(Master,(December(2013( 91(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
Cacheable(
"Web(Intelligence"(Master,(December(2013( 92(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
Client/Stateless/Server(
Cacheable(
"Web(Intelligence"(Master,(December(2013( 93(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
Client/Cache/Stateless/Server(
Cacheable(
"Web(Intelligence"(Master,(December(2013( 94(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
Client/Cache/Stateless/Server(
The(early(Web(architecture((prior(to(1994).(
Cacheable(
"Web(Intelligence"(Master,(December(2013( 95(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
Client/Cache/Stateless/Server(
The(early(Web(architecture((prior(to(1994).(• no(consistent(set(of(seman-cs(for(all(resources,(just(CERN(libwww.(
Uniform(Interface(
• Central(to(REST,(decouples(the(architecture.(
"Web(Intelligence"(Master,(December(2013( 96(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
Uniform(Interface(
• Central(to(REST,(decouples(the(architecture.(• Design(principle:(generality.(
"Web(Intelligence"(Master,(December(2013( 97(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
Uniform(Interface(
• Central(to(REST,(decouples(the(architecture.(• Design(principle:(generality.(
"Web(Intelligence"(Master,(December(2013( 98(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
remember(the(Y2K(bug?(
"Web(Intelligence"(Master,(December(2013( 99(
h\p://en.wikipedia.org/wiki/Year_2000_problem(
Uniform(Interface(
• Central(to(REST,(decouples(the(architecture.(• Design(principle:(generality.(
"Web(Intelligence"(Master,(December(2013( 100(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
Uniform(Interface(
• Central(to(REST,(decouples(the(architecture.(• Design(principle:(generality.(• Induced(proper-es:(
– increased(evolvability,(simplicity,(visibility.(• Tradeoff:(
– degraded(efficiency,(informa-on(being(transferred(in(a(standard(form,(and(not(in(an(applica-on/specific(form.(
"Web(Intelligence"(Master,(December(2013( 101(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
Uniform(Interface(
"Web(Intelligence"(Master,(December(2013( 102(
Iden-fica-on(of(resources(
Manipula-on(of(resources((through(representa-ons(
Self/descrip-ve(messages(
HATEOAS(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
4(interface(constraints:(
Uniform(Interface(
"Web(Intelligence"(Master,(December(2013( 103(
Iden-fica-on(of(resources(
Manipula-on(of(resources((through(representa-ons(
Self/descrip-ve(messages(
HATEOAS(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
4(interface(constraints:(
What(is(a(resource?(
Uniform(Interface(
"Web(Intelligence"(Master,(December(2013( 104(
Iden-fica-on(of(resources(
Manipula-on(of(resources((through(representa-ons(
Self/descrip-ve(messages(
HATEOAS(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
4(interface(constraints:(
What(is(a(resource?(
Any(informa-on(that(can(be(named(is(a(resource.(
Uniform(Interface(
"Web(Intelligence"(Master,(December(2013( 105(
Iden-fica-on(of(resources(
Manipula-on(of(resources((through(representa-ons(
Self/descrip-ve(messages(
HATEOAS(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
4(interface(constraints:(
What(is(a(resource?(
Any(informa-on(that(can(be(named(is(a(resource.(
A(representa5on(is(a(sequence(of(bytes(and(the(descrip-on(of(those(bytes((e.g.,(HTML,(XML,(JSON).(
Uniform(Interface(
"Web(Intelligence"(Master,(December(2013( 106(
Iden-fica-on(of(resources(
Manipula-on(of(resources((through(representa-ons(
Self/descrip-ve(messages(
HATEOAS(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
A(resource(has(a((resource'iden5fier((e.g.,(URI).((
The(naming'authority(that(assigns(a(resource(iden-fier(is(responsible(for(maintaining(the(seman-c(validity(of(the(mapping(over(-me.(
4(interface(constraints:(
Uniform(Interface(
"Web(Intelligence"(Master,(December(2013( 107(
Iden-fica-on(of(resources(
Manipula-on(of(resources((through(representa-ons(
Self/descrip-ve(messages(
HATEOAS(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
A(client(does(not(have(access(to(a(resource(directly.(It(can(only(send(and(receive(representa-ons(to(and(from(a(server.(
4(interface(constraints:(
Uniform(Interface(
"Web(Intelligence"(Master,(December(2013( 108(
Iden-fica-on(of(resources(
Manipula-on(of(resources((through(representa-ons(
Self/descrip-ve(messages(
HATEOAS(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
A(message(must(include(metadata(describing(its(meaning.((Methods(used(to(invoke(the(message(must(be(standard(and(agreeable(between(the(client,(the(server,(and(intermediaries(in(between.(
4(interface(constraints:(
Uniform(Interface(
"Web(Intelligence"(Master,(December(2013( 109(
Iden-fica-on(of(resources(
Manipula-on(of(resources((through(representa-ons(
Self/descrip-ve(messages(
HATEOAS(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
Applica-on(states(are(reachable(only(through(hypermedia.(
4(interface(constraints:(
Hypermedia(As(The(Engine(Of(Applica-on(State(
Uniform(Interface(
"Web(Intelligence"(Master,(December(2013( 110(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
Client/Cache/Stateless/Server(
Uniform(Interface(
"Web(Intelligence"(Master,(December(2013( 111(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
Uniform/Client/Cache/Stateless/Server(
Layered(System(
• The(architecture(may(be(composed(of(hierarchical(layers(of(components,(restric-ng(knowledge(of(the(system(to(a(single(layer.(– A(client(cannot(tell(if(it(is(communica-ng(with(an(end(server(or(an(
intermediary.(
• Induced(proper-es:(– Intermediary(servers(may(improve(system(scalability(through(load/
balancing(and(shared(caches.(
• Tradeoff:(– may(reduce(user/received(performance(due(to(having(several(levels(of(
indirec-on.(
"Web(Intelligence"(Master,(December(2013( 112(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
Layered(System(
"Web(Intelligence"(Master,(December(2013( 113(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
Uniform/Layered/Client/Cache/Stateless/Server(
Code/On/Demand(
• The(func-onality(of(the(client(can(be(extended(by(downloading(and(execu-ng(code((e.g.,(applets,(scripts).(
• An(op-onal(constraint.(• Induced(proper-es:(
– simplifies(clients;(
– improves(scalability,(off/loading(work(onto(clients.(• Tradeoff:(
– reduced(visibility.(
"Web(Intelligence"(Master,(December(2013( 114(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
A(RESTful(Architecture(
"Web(Intelligence"(Master,(December(2013( 115(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
REST(
REST(and(HTTP(
• REST(is(not(the(HTTP(verbs.(
• REST(is(a(set(of(constraints(that(guided(the(design(of(HTTP(1.1,(by(iden-fying(problems(and(providing(solu-ons(to(those(problems(wrt(the(requirements(of(the(Web.(
• HTTP(was(designed(specifically(to(manipulate(resources(via(representa5on'transfer.(
• There(are(some(mismatches(between(HTTP(1.1(and(REST.(– e.g.,(cookies(promote(sessions(on(the(server.(
"Web(Intelligence"(Master,(December(2013( 116(
R.(Fielding.(Architectural(Styles(and(the(Design(of(Network/based(So|ware(Architectures,(2000(
WS/*(and(REST(
• WS/*(uses(HTTP(as(a(transport(protocol(– SOAP(uses(only(POST(
• HTTP/based(caching(not(possible(• The(opera-on(itself(is(pushed(in(the(SOAP(message(
– Applica-ons(remain(outside'of'the'Web'
• REST(uses(HTTP(as(an(applica5on(protocol(– Applica-ons(are(part'of'the'Web'
"Web(Intelligence"(Master,(December(2013( 117(
C.(Pautasso,(O.(Zimmermann,(and(F.(Leymann:(RESTful(Web(Services(vs.(“Big”(Web(Services.(Making(the(Right(Architectural(Decision,(2008.(
WS/*(and(REST(
"Web(Intelligence"(Master,(December(2013( 118(
“In(the(Web(of(Things,(we(are(considering(smart(things(as(first/class(ci-zens(of(the(Web(and(posi-on(the(WoT(as(a(refinement(of(the(IoT(by(integra-ng(smart(things(not(only(into(the(Internet((the(network),(but(into(the(Web((the(applica-on(layer).”(
Using(the(Web(as(an(applica-on(architecture,(and(not(as(a(transporta-on(layer.(
“The(emerging(Web(of(Things(is(a(concrete(implementa-on(of(the(Internet(of(Things(vision(that(focuses(on(establishing(applica-on/level(connec-vity(between(heterogeneous(devices.”((
S.(Mayer(and(G.(Basler.(Seman-c(metadata(to(support(device(interac-on(in(smart(environments,(2013.(
D.(Guinard.(A(Web(of(Things(Applica-on(Architecture(–(Integra-ng(the(Real/World(into(the(Web,(2011.(
WoT'Defini5ons'Revisited'
WS/*(and(REST(
• REST(vs.(SOAP(on(resource/constrained(devices(
"Web(Intelligence"(Master,(December(2013( 119(
D.(Yazar(and(A.(Dunkels:(Efficient(Applica-on(Integra-on(in(IP/based(Sensor(Networks,(2009.(
Material(adapted(from:(S.(Mayer.(Service(integra-on(in(the(Web(of(Things,(École(d’Éte(Web(Intelligence(2013(–(Web(des(Objets,(2013.(
WS/*(and(REST(• A(developer’s(perspec-ve(
– ETH(Zurich(– 69(computer(science(students((3rd(or(4th(year(of(Bachelor(studies)(
"Web(Intelligence"(Master,(December(2013( 120(
D.(Guinard,(I.(Ion,(and(S.(Mayer.(REST(or(WS/*?(A(developers’(perspec-ve,(2011.(
REST:(• very(easy(to(understand,(learn(and(
implement(• More(lightweight(and(scalable'
WSI*:(• WSDL(enables(service'contracts'• Be\er(security(features(• Be\er(level(of(abstrac5on'(
Ease(of(learning( Speed(of(learning(
Material(adapted(from:(S.(Mayer.(Service(integra-on(in(the(Web(of(Things,(École(d’Éte(Web(Intelligence(2013(–(Web(des(Objets,(2013.(
WS/*(and(REST(
• REST(is(well(suited(for(“Do/It/Yourself”,(ad/hoc(integra-on(over(the(Web((mashups)(
• WS/*(is(well(suited(in(enterprise(applica-ons(with(advanced(QoS(requirements(– However,(REST(gains(more(adop-on(here(as(well(
"Web(Intelligence"(Master,(December(2013( 121(
C.(Pautasso,(O.(Zimmermann,(and(F.(Leymann:(RESTful(Web(Services(vs.(“Big”(Web(Services.(Making(the(Right(Architectural(Decision,(2008.(
WS/*(and(REST(• UDDI(discon5nued(by(IBM,(Microso|,(SAP(in(2006(
– Func-onality(removed(from(Windows(Server(in(2010(
• WS/*(APIs(discon5nued(by(Google(in(2011((
Google(Trends,(2004/2013(
"Web(Intelligence"(Master,(December(2013( 122(
Material(adapted(from:(S.(Mayer.(Service(integra-on(in(the(Web(of(Things,(École(d’Éte(Web(Intelligence(2013(–(Web(des(Objets,(2013.(
• Introduc-on(• Web(Services(
– WS/*(Web(Services(– RESTful(Web(Services(
• RESTifying'Things'• Service(Integra-on(in(the(WoT(• The(Social(Web(of(Things(
123(
Outline(
"Web(Intelligence"(Master,(December(2013(
RESTifying(Things(
"Web(Intelligence"(Master,(December(2013( 124(
D.(Guinard.(A(Web(of(Things(Applica-on(Architecture(–(Integra-ng(the(Real/World(into(the(Web,(2011.(
Resource(Design(
Representa-on(Design(
Implementa-on(Strategy(
Interface(Design(
RESTifying(Things(
"Web(Intelligence"(Master,(December(2013( 125(
Resource(Design(
Representa-on(Design(
Implementa-on(Strategy(
Interface(Design(
Resource:(any(component(of(an(applica-on(that(is(worth(being(uniquely(iden-fied(and(linked(to.(
D.(Guinard.(A(Web(of(Things(Applica-on(Architecture(–(Integra-ng(the(Real/World(into(the(Web,(2011.(
RESTifying(Things(
"Web(Intelligence"(Master,(December(2013( 126(
Resource(Design(
Representa-on(Design(
Implementa-on(Strategy(
Interface(Design(
Resource:(any(component(of(an(applica-on(that(is(worth(being(uniquely(iden-fied(and(linked(to.(
M.(Kovatsch,(S.(Mayer,(and(B.(Ostermaier.(Towards(the(thin(server(architecture(for(the(Internet(of(Things,(2012.(
RESTifying(Things(
"Web(Intelligence"(Master,(December(2013( 127(
D.(Guinard.(A(Web(of(Things(Applica-on(Architecture(–(Integra-ng(the(Real/World(into(the(Web,(2011.(
Resource(Design(
Representa-on(Design(
Implementa-on(Strategy(
Interface(Design(
Resource:(any(component(of(an(applica-on(that(is(worth(being(uniquely(iden-fied(and(linked(to.(
h\p://<DOMAIN>:<PORT>/genericNodes/node1/sensors/light(
RESTifying(Things(
"Web(Intelligence"(Master,(December(2013( 128(
D.(Guinard.(A(Web(of(Things(Applica-on(Architecture(–(Integra-ng(the(Real/World(into(the(Web,(2011.(
Resource(Design(
Representa-on(Design(
Implementa-on(Strategy(
Interface(Design(
Resource:(any(component(of(an(applica-on(that(is(worth(being(uniquely(iden-fied(and(linked(to.(
h\p://<DOMAIN>:<PORT>/genericNodes/node1/sensors/light(
Guidelines(for(resource'iden5fiers((i.e.(URIs):(• Use(descrip-ve(names.(• Use(the(plural(form(for(aggregate(resources.(
RESTifying(Things(
"Web(Intelligence"(Master,(December(2013( 129(
D.(Guinard.(A(Web(of(Things(Applica-on(Architecture(–(Integra-ng(the(Real/World(into(the(Web,(2011.(
Resource(Design(
Representa-on(Design(
Implementa-on(Strategy(
Interface(Design(
Resource:(any(component(of(an(applica-on(that(is(worth(being(uniquely(iden-fied(and(linked(to.(
h\p://<DOMAIN>:<PORT>/genericNodes/node1/sensors/light(
Guidelines(for(resource'iden5fiers((i.e.(URIs):(• Use(descrip-ve(names.(• Use(the(plural(form(for(aggregate(resources.(
(HATEOAS)(A(resource(should(link(to(its(parent,(children(and(other(related(resources.(
RESTifying(Things(
"Web(Intelligence"(Master,(December(2013( 130(
D.(Guinard.(A(Web(of(Things(Applica-on(Architecture(–(Integra-ng(the(Real/World(into(the(Web,(2011.(
Resource(Design(
Representa-on(Design(
Implementa-on(Strategy(
Interface(Design(
Resources(are(abstract(en--es,(they(can(have(mul-ple(representa-ons(in(different(formats((e.g.,(HTML,(JSON,(XML).(
Recommenda-ons:(• human/to/machine(interac-on:(HTML.(• machine/to/machine(interac-on:(JSON.(
RESTifying(Things(
"Web(Intelligence"(Master,(December(2013( 131(
D.(Guinard.(A(Web(of(Things(Applica-on(Architecture(–(Integra-ng(the(Real/World(into(the(Web,(2011.(
Resource(Design(
Representa-on(Design(
Implementa-on(Strategy(
Interface(Design(
Resources(are(abstract(en--es,(they(can(have(mul-ple(representa-ons(in(different(formats((e.g.,(HTML,(JSON,(XML).(
Recommenda-ons:(• human/to/machine(interac-on:(HTML.(• machine/to/machine(interac-on:(JSON.(
RESTifying(Things(
"Web(Intelligence"(Master,(December(2013( 132(
D.(Guinard.(A(Web(of(Things(Applica-on(Architecture(–(Integra-ng(the(Real/World(into(the(Web,(2011.(
Resource(Design(
Representa-on(Design(
Implementa-on(Strategy(
Interface(Design(
Opera5ons((HTTP(verbs):(• GET:(retrieve(the(resource(
• e.g.,(GET /genericNodes/node1/sensors/temperature • PUT:(update(the(value(of(a(resource(
• e.g.,(PUT /genericNodes/node1/actuators/leds/led1 {“status”:“on”} • POST:(create(a(new(resource(
• e.g.,(POST /genericNodes/node1/sensors/temperature/rules {“threshold”:42} • DELETE:(delete(the(resource(
• e.g.,(DELETE /genericNodes/node1/sensors/temperature/rules/1(• OPTIONS:(retrieve(allowed(opera-ons(
• e.g.,(OPTIONS /genericNodes/node1/sensors/temperature/rules/(
RESTifying(Things(
"Web(Intelligence"(Master,(December(2013( 133(
Resource(Design(
Representa-on(Design(
Implementa-on(Strategy(
Interface(Design(
Opera5ons((HTTP(verbs):(• GET:(retrieve(the(resource(• PUT:(update(the(value(of(a(resource(• POST:(create(a(new(resource(• DELETE:(delete(the(resource(• OPTIONS:(retrieve(allowed(opera-ons(
D.(Guinard.(A(Web(of(Things(Applica-on(Architecture(–(Integra-ng(the(Real/World(into(the(Web,(2011.(
RESTifying(Things(
"Web(Intelligence"(Master,(December(2013( 134(
Resource(Design(
Representa-on(Design(
Implementa-on(Strategy(
Interface(Design(
Opera5ons((HTTP(verbs):(• GET:(retrieve(the(resource(• PUT:(update(the(value(of(a(resource(• POST:(create(a(new(resource(• DELETE:(delete(the(resource(• OPTIONS:(retrieve(allowed(opera-ons(ContentInego5a5on'
• HTTP(Header,(e.g.(Accept • Recommenda-on:(support(content(nego-a-on(in(the(URI(as(well(• e.g.,(GET /genericNodes/node1/sensors/temperature.json(
D.(Guinard.(A(Web(of(Things(Applica-on(Architecture(–(Integra-ng(the(Real/World(into(the(Web,(2011.(
RESTifying(Things(
"Web(Intelligence"(Master,(December(2013( 135(
Resource(Design(
Representa-on(Design(
Implementa-on(Strategy(
Interface(Design(
Opera5ons((HTTP(verbs):(• GET:(retrieve(the(resource(• PUT:(update(the(value(of(a(resource(• POST:(create(a(new(resource(• DELETE:(delete(the(resource(• OPTIONS:(retrieve(allowed(opera-ons(ContentInego5a5on'
• HTTP(Header,(e.g.(Accept • Recommenda-on:(support(content(nego-a-on(in(the(URI(as(well(• e.g.,(GET /genericNodes/node1/sensors/temperature.json(
Status'codes'• ( e.g.,(HTTP/1.1 405 Method Not Allowed
D.(Guinard.(A(Web(of(Things(Applica-on(Architecture(–(Integra-ng(the(Real/World(into(the(Web,(2011.(
RESTifying(Things(
"Web(Intelligence"(Master,(December(2013( 136(
h\p://dev.evrythng.com/documenta-on/api(
h\p://www.evrythng.com(
Resource(Design(
Representa-on(Design(
Implementa-on(Strategy(
Interface(Design(
RESTifying(Things(
"Web(Intelligence"(Master,(December(2013( 137(
h\p://dev.evrythng.com/documenta-on/api(
h\p://www.evrythng.com(
Resource(Design(
Representa-on(Design(
Implementa-on(Strategy(
Interface(Design(
RESTifying(Things(
"Web(Intelligence"(Master,(December(2013( 138(
h\p://dev.evrythng.com/documenta-on/api(
h\p://www.evrythng.com(
Resource(Design(
Representa-on(Design(
Implementa-on(Strategy(
Interface(Design(
RESTifying(Things(
"Web(Intelligence"(Master,(December(2013( 139(
h\p://dev.evrythng.com/documenta-on/api(
h\p://www.evrythng.com(
Resource(Design(
Representa-on(Design(
Implementa-on(Strategy(
Interface(Design(
RESTifying(Things(
"Web(Intelligence"(Master,(December(2013( 140(
Resource(Design(
Representa-on(Design(
Implementa-on(Strategy(
Interface(Design(
D.(Guinard.(A(Web(of(Things(Applica-on(Architecture(–(Integra-ng(the(Real/World(into(the(Web,(2011.(
• Introduc-on(• Web(Services(
– WS/*(Web(Services(– RESTful(Web(Services(
• RESTifying(Things(• Service'Integra5on'in'the'WoT'• The(Social(Web(of(Things(
141(
Outline(
"Web(Intelligence"(Master,(December(2013( "Web(Intelligence"(Master,(December(2013( 142(
Jean(Claude,(a(WoT(enthusiast(
"Web(Intelligence"(Master,(December(2013( 143(
Jean(Claude,(a(WoT(enthusiast(
known( unknown(
Service(Integra-on(in(the(WoT(
'Challenges(in(service(integra-on(• Arrive/and/Operate:(Service(Discovery(and(Look/up(• Physical(Mashups(• Automa-c(Service(Composi-on(
"Web(Intelligence"(Master,(December(2013( 144(
Material(adapted(from:(S.(Mayer.(Service(integra-on(in(the(Web(of(Things,(École(d’Éte(Web(Intelligence(2013(–(Web(des(Objets,(2013.(
Arrive/and/Operate(
Service(Discovery:(– Adver-sing(services(that(are(provided(by(devices(within(a(smart(environment,(e.g.,(DiscoWoT(
(
Service(Look/up:(– It’s(not'sta5c'text(documents(anymore!(
• e.g.,(“Empty(rooms(that(have(a(temperature'of'23°C”(• Possible(to(use(Google(for(this?(
– Which(aeributes?(Keywords,(Device(Type,(Reviews…(– Search(engines(for(the(WoT,(e.g.,(Dyser,(InfraWoT(
"Web(Intelligence"(Master,(December(2013( 145(
S.(Mayer,(D.(Guinard,(and(V.(Trifa.(Searching(in(a(Web/based(Infrastructure(for(Smart(Things,(2012.(B.(Ostermaier,(K.(Römer,(F.(Ma\ern,(M.(Fahrmair,(and(W.(Kellerer.(A(Real/Time(Search(Engine(for(the(Web(of(Things,(2010.(
S.(Mayer,(D.(Guinard.(An(Extensible(Discovery(Service(for(Smart(Things,(2011.(
Material(adapted(from:(S.(Mayer.(Service(integra-on(in(the(Web(of(Things,(École(d’Éte(Web(Intelligence(2013(–(Web(des(Objets,(2013.(
Physical(Mashups(
Composite(WoT(applica-ons,(involving(smart(things(and(virtual(services.(
– Inspired(by(Web(2.0(mashups.((
Physical(mashup(development:(– Manual(mashup(development(– Widget/based(mashup(development(– End/user(mashup(development(
"Web(Intelligence"(Master,(December(2013( 146(
D.(Guinard.(A(Web(of(Things(Applica-on(Architecture(–(Integra-ng(the(Real/World(into(the(Web,(2011.(
Automa-c(Service(Composi-on(
• Embed(informa-on(about(what(smart(things(can(do:(– Syntac5c(level((e.g.,(data(types,(measurement(units)(– Seman5c(level((data(meaning)(
"Web(Intelligence"(Master,(December(2013( 147(
Example(from(S.(Mayer(and(G.(Basler.(Seman-c(metadata(to(support(device(interac-on(in(smart(environments,(2013.(
• Introduc-on(• Web(Services(
– WS/*(Web(Services(– RESTful(Web(Services(
• RESTifying(Things(• Service(Integra-on(in(the(WoT(• The'Social'Web'of'Things'
148(
Outline(
"Web(Intelligence"(Master,(December(2013(
The(Social(Web(of(Things(
"Web(Intelligence"(Master,(December(2013( 149(
A.(Ciortea,(O.(Boissier,(A.(Zimmermann,(and(A.(Florea.(Reconsidering(the(Social(Web(of(Things:(Posi-on(Paper,(2013.(
The(Social(Web(of(Things(
"Web(Intelligence"(Master,(December(2013( 150(
A.(Ciortea,(O.(Boissier,(A.(Zimmermann,(and(A.(Florea.(Reconsidering(the(Social(Web(of(Things:(Posi-on(Paper,(2013.(
The(Social(Web(of(Things(
"Web(Intelligence"(Master,(December(2013( 151(
A.(Ciortea,(O.(Boissier,(A.(Zimmermann,(and(A.(Florea.(Reconsidering(the(Social(Web(of(Things:(Posi-on(Paper,(2013.(
The(Social(Web(of(Things(
"Web(Intelligence"(Master,(December(2013( 152(
A.(Ciortea,(O.(Boissier,(A.(Zimmermann,(and(A.(Florea.(Reconsidering(the(Social(Web(of(Things:(Posi-on(Paper,(2013.(
The(Social(Web(of(Things(
"Web(Intelligence"(Master,(December(2013( 153(
A.(Ciortea,(O.(Boissier,(A.(Zimmermann,(and(A.(Florea.(Reconsidering(the(Social(Web(of(Things:(Posi-on(Paper,(2013.(
The(Social(Web(of(Things(
"Web(Intelligence"(Master,(December(2013( 154(
A.(Ciortea,(O.(Boissier,(A.(Zimmermann,(and(A.(Florea.(Reconsidering(the(Social(Web(of(Things:(Posi-on(Paper,(2013.(
• Web(technologies(enabled(users(to(be(proac5ve(on(the(Web.(• Exci-ng(-mes(ahead:(seman-c(Web(technologies,(Linked(Data(Plaqorm,(
Push(API,(CoAP,(etc.(
• Can(we(enable(things(to(be(proac-ve?(
The(Social(Web(of(Things(
Problem:((Placing(autonomous(and(proac-ve(things(on(the(Web.(
(
Where(to(start?((Socio/technical(networks(
(
Mo-va-on:(• Providing(a(good(experience(for(the(WoT(user(• Extending(the(percep-on(of(things(• Providing(a(framework(for(the(development(of(complex(WoT(
applica-ons.(
"Web(Intelligence"(Master,(December(2013( 155(
A.(Ciortea,(O.(Boissier,(A.(Zimmermann,(and(A.(Florea.(Reconsidering(the(Social(Web(of(Things:(Posi-on(Paper,(2013.(
The(Social(Web(of(Things(
"Web(Intelligence"(Master,(December(2013( 156(
A.(Ciortea,(O.(Boissier,(A.(Zimmermann,(and(A.(Florea.(Reconsidering(the(Social(Web(of(Things:(Posi-on(Paper,(2013.(
Applica-on(
Norma-ve(
Social(
Agency(
RESTful(WoT(API(
The(Social(Web(of(Things(
"Web(Intelligence"(Master,(December(2013( 157(
A.(Ciortea,(O.(Boissier,(A.(Zimmermann,(and(A.(Florea.(Reconsidering(the(Social(Web(of(Things:(Posi-on(Paper,(2013.(
Applica-on(
Norma-ve(
Social(
Agency(
RESTful(WoT(API(
Agents(as(individuals(
• Connec-vity:(at(the(level(of(the(SNS(• Rela-onship(management:(hardcoded(in(the(agent(• Decision/making:(Based(on(agent’s(knowledge(• Coordina-on(mechanisms:(hardcoded(in(the(agent(• Control(of(autonomy:(applica-on/level(
The(Social(Web(of(Things(
"Web(Intelligence"(Master,(December(2013( 158(
A.(Ciortea,(O.(Boissier,(A.(Zimmermann,(and(A.(Florea.(Reconsidering(the(Social(Web(of(Things:(Posi-on(Paper,(2013.(
Applica-on(
Norma-ve(
Social(
Agency(
RESTful(WoT(API(
Agents(in(social(structures(
• Connec-vity:(open'set'of'social'networks'• Rela-onship(management:(hardcoded(in(the(agent(• Decision/making:(Based(on(collec5ve(knowledge(• Coordina-on(mechanisms:(hardcoded(in(the(agent(• Control(of(autonomy:(applica-on/level(
The(Social(Web(of(Things(
"Web(Intelligence"(Master,(December(2013( 159(
A.(Ciortea,(O.(Boissier,(A.(Zimmermann,(and(A.(Florea.(Reconsidering(the(Social(Web(of(Things:(Posi-on(Paper,(2013.(
Applica-on(
Norma-ve(
Social(
Agency(
RESTful(WoT(API(
Agents(in(organiza-ons(
Enabling:(• Structural'control:(encourage(of(discourage(
connec-ons(among(things;(• Communica5on'control:(placing(informa-on(
in(the(appropriate(context;(• Func5onal'control:(coordina-on(mechanisms(
through(top/down(specifica-ons(of(organiza-onal(processes.(
The(Social(Web(of(Things(
"Web(Intelligence"(Master,(December(2013( 160(
A.(Ciortea,(O.(Boissier,(A.(Zimmermann,(and(A.(Florea.(Reconsidering(the(Social(Web(of(Things:(Posi-on(Paper,(2013.(
Applica-on(
Norma-ve(
Social(
Agency(
RESTful(WoT(API(
Agents(in(organiza-ons(
• Connec-vity:(open(set(of(social(networks(• Rela-onship(management:(can'be'enforced'• Decision/making:(Based(on(collec-ve(and'
organiza5onal(knowledge(• Coordina-on(mechanisms:(organiza5onal'
processes'• Control(of(autonomy:(organiza5onIlevel'
• Introduc-on(• Web(Services(
– WS/*(Web(Services(– RESTful(Web(Services(
• RESTifying(Things(• Service(Integra-on(in(the(WoT(• The(Social(Web(of(Things(
161(
Outline(
"Web(Intelligence"(Master,(December(2013(
Conclusions(
The(Web'of'Things(is(about(enabling(smart'things(as(firstIclass'ci5zens'of'the'Web.(
(
Mo-va-on:(Create(a(loosely'coupled(ecosystem(
of(services(for(smart(things.((
Lower(the(entry'barrier(for(WoT(applica-on(developers.(
"Web(Intelligence"(Master,(December(2013( 162(
Conclusions(
The(REST'architectural'style(induces(proper-es(that(are(useful(for(smart(environments.(
(
The(Web(is(RESTful,(so(the(WoT(should(be(RESTful.(
(
There(is(a(lot(of(exci5ng,'uncharted'territory.(
"Web(Intelligence"(Master,(December(2013( 163(
Conclusions(
Some(of(the(new(cool(kids(on(the(block:((((The(Web(of(Things(Community:(
– Community(blog:(h\p://www.webo|hings.org(– Web(of(Things(Workshop(Series(
• WoT(2010(@(PerCom,(Mannheim(• WoT(2011(@(Pervasive,(San(Francisco(• WoT(2012(@(Pervasive,(Newcastle(• WoT(2013(@(UbiComp,(Zurich(
"Web(Intelligence"(Master,(December(2013( 164(