37
Enabling Embedded Systems to access Internet Resources

Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

Enabling Embedded Systems to access Internet Resources

Page 2: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

2

Enabling Embedded Systems to access Internet ResourcesEmbedded Internet Book

www.EmbeddedInternet.org

Page 3: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

3

Agenda

Enabling Embedded Systems to access Internet Resources: RATIONALE

Web Services: INTRODUCTION

HTTP Protocol: REVIEW

HTTP Protocol Bindings

Testing a Web Service

Application Case: Using Web Services for DNS Resolution

Implementing and Testing the Web Service

Implementing and Testing the Embedded Application

Page 4: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

4

Enabling Embedded Systems to access Internet ResourcesRATIONALE

Embedded Systems have limited resources compared with PCs.

Some applications may require large memory space and high processing power.

ComplexAlgorithms

CPU-IntensiveProcesses

EmbeddedDatabase

ApplicationsCPU

MemoryCPUMemory

Page 5: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

5

Enabling Embedded Systems to access Internet ResourcesALTERNATIVE SOLUTION

Adding a TCP/IP Stack, Embedded Systems will have internet-connectivity which allows them access Internet Resources.

Page 6: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

6

Enabling Embedded Systems to access Internet ResourcesALTERNATIVE SOLUTION

In this scenario, complex tasks could be resolved remotely in external servers.

ComplexTasks

ComplexTasks

Page 7: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

7

Enabling Embedded Systems to access Internet ResourcesALTERNATIVE SOLUTION

In other words, Embedded Systems could greatly benefit from the “external intelligence” provided by Desktop servers connected to the Internet, without the need of additional resources.

INTERNET

Page 8: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

8

Enabling Embedded Systems to access Internet ResourcesIMPLEMENTATION

A Remote Procedure could be called in order to resolve complex tasks, such as complex algorithms, CPU-intensive calculations, or retrieve records from a DataBase.

Ok. But how to implement this?

Using Web Services !

Page 9: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

9

Web ServicesIntroduction

Page 10: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

10

Enabling Embedded Systems to access Internet ResourcesWEB SERVICES - Introduction

What are Web Services?

They are a Standardized way to call a remote procedure over the Internet.

They allow a distributing computing schema to work independently from the technology, language, and device.

Servers expose a piece of functionality through a Web Interface.

Clients consume this functionality from its application, using standard Internet protocols (HTTP, SOAP, XML).

HTTP is used as the transport protocol, to move messages between Clients and Servers - for secure transmissions, HTTPS can be used - (Advantage: most firewalls allow HTTP traffic).

These messages formats are defined according to the SOAP protocol. The SOAP messages are encoded using XML.

Page 11: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

11

Enabling Embedded Systems to access Internet ResourcesWEB SERVICES – Typical Scenario

Page 12: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

12

Enabling Embedded Systems to access Internet ResourcesWEB SERVICES – Standards

Page 13: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

13

Enabling Embedded Systems to access Internet ResourcesWEB SERVICES – Standards (Cont.)

Page 14: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

14

Enabling Embedded Systems to access Internet ResourcesWEB SERVICES – Transport Protocol: HTTP

Page 15: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

15

HTTP Protocol:Review

Page 16: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

16

Enabling Embedded Systems to access Internet ResourcesHTTP session example

Page 17: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

17

Enabling Embedded Systems to access Internet ResourcesHTTP Messages Format

Page 18: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

18

Enabling Embedded Systems to access Internet ResourcesHTTP Messages Examples

Request:

Response:

Page 19: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

19

HTTP Protocol Bindings

Page 20: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

20

Enabling Embedded Systems to access Internet ResourcesWEB SERVICES – Protocol Bindings

SOAP (versions 1.1 and 1.2)

HTTP POST

HTTP GET (simplest - recommended for Embedded systems)

Page 21: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

21

Enabling Embedded Systems to access Internet ResourcesWEB SERVICES – SOAP 1.1 Binding

Page 22: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

22

Enabling Embedded Systems to access Internet ResourcesWEB SERVICES – SOAP 1.2 Binding

Page 23: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

23

Enabling Embedded Systems to access Internet ResourcesWEB SERVICES – POST Binding

Page 24: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

24

Enabling Embedded Systems to access Internet ResourcesWEB SERVICES – GET Binding

Page 25: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

25

Enabling Embedded Systems to access Internet ResourcesWEB SERVICES – Binding Configurations ( web.config )

Page 26: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

26

Testing a Web Service

Page 27: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

27

Enabling Embedded Systems to access Internet ResourcesWEB SERVICES – Testing the Web Service (1/3)

Page 28: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

28

Enabling Embedded Systems to access Internet ResourcesWEB SERVICES – Testing the Web Service (2/3)

Page 29: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

29

Enabling Embedded Systems to access Internet ResourcesWEB SERVICES – Testing the Web Service (3/3)

Page 30: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

30

Enabling Embedded Systems to access Internet ResourcesWEB SERVICES – Consuming a Web Service from the Browser

Using the Web Service throughthe HTTP URL syntax

http://www.embeddedinternet.org/Book/WebServices/MathService.asmx/Add?a=1&b=2

Page 31: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

31

Application Case:Using Web Services for DNS Resolution

Page 32: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

32

Enabling Embedded Systems to access Internet ResourcesImplementing the “DnsService” Web Service

Page 33: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

33

Enabling Embedded Systems to access Internet ResourcesTesting the “DnsService” Web Service

www.embeddedinternet.org/Book/WebServices/DnsService.asmx/DnsResolve?dn=www.intramarket.com.ar

Page 34: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

34

Enabling Embedded Systems to access Internet ResourcesConsuming the “DnsService” Web Service from anEmbedded System

Create a TCP socket and open a connection to Port 80 ( IP address of the server where the Web Service is published)

Once the connection is established, create and send the Web Service Request

When the Response is received, process the XML and extract the result

Close the connection and the TCPsocket

Page 35: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

35

Enabling Embedded Systems to access Internet ResourcesTesting the Embedded Application - Web Service Request

Page 36: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

36

Enabling Embedded Systems to access Internet ResourcesTesting the Embedded Application - Web Service Response

Page 37: Enabling Embedded Systems to access Internet Resources · 2016-02-21 · 4 Enabling Embedded Systems to access Internet Resources RATIONALE Embedded Systems have limited resources

37