Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
cours:mit_2018_2019:soa4iotlab [2019/01/29 07:00] tigli [SOA for IoT and WS-SOAP] |
cours:mit_2018_2019:soa4iotlab [2019/02/05 07:57] (Version actuelle) tigli |
||
---|---|---|---|
Ligne 20: | Ligne 20: | ||
[[https://curl.haxx.se/|curl]] is used in command lines or scripts to transfer data. | [[https://curl.haxx.se/|curl]] is used in command lines or scripts to transfer data. | ||
- | |||
Curl is mainly used to send/receive some HTTP messages with command lines. That's the reason why curl is well adapted for first [[https://www.baeldung.com/curl-rest|tests of Rest services]]. | Curl is mainly used to send/receive some HTTP messages with command lines. That's the reason why curl is well adapted for first [[https://www.baeldung.com/curl-rest|tests of Rest services]]. | ||
Ligne 26: | Ligne 25: | ||
Lot of WS-REST API are available on the web. Big compagnies provide some Cloud of Services using this kind of access. For example the IBM Cloud provides [[https://cloud.ibm.com/catalog?search=REST|its own list of services]]. | Lot of WS-REST API are available on the web. Big compagnies provide some Cloud of Services using this kind of access. For example the IBM Cloud provides [[https://cloud.ibm.com/catalog?search=REST|its own list of services]]. | ||
- | **Exercice**: After Signin, test services like TexttoSpeech with curl. | + | Look at a "text to speech" demonstration [[https://text-to-speech-demo.ng.bluemix.net/|here]] |
+ | |||
+ | **Exercice**: After Sign up, test services like TexttoSpeech with curl. Find more details in a step by step tutorial [[https://console.bluemix.net/docs/services/text-to-speech/getting-started.html#gettingStarted|here]]. | ||
**Question**: Look at IBM Watson IoT Plateform. What does it provide ? | **Question**: Look at IBM Watson IoT Plateform. What does it provide ? | ||
Ligne 53: | Ligne 54: | ||
{{:cours:mit_2018_2019:node-red_solution_assembly_export.rtf|}} | {{:cours:mit_2018_2019:node-red_solution_assembly_export.rtf|}} | ||
- | |||
- | |||
** Rest server : ** | ** Rest server : ** | ||
Ligne 62: | Ligne 61: | ||
**Exercice**: | **Exercice**: | ||
To create a WS-Rest in Node-Red : | To create a WS-Rest in Node-Red : | ||
- | - Use the http node from the input block to handle request from outside. | + | - Use the http node from the input block to handle request from outside on the following URL: /date |
- Drag the http response node from the output block. This will output the payload of the msg as response of API. | - Drag the http response node from the output block. This will output the payload of the msg as response of API. | ||
- | - Now go to your browser and hit http://localhost:1880/users to use your WS-REST API. | + | - Add the current date as a response to the REST GET request on /date |
+ | - Now go to your browser and hit http://localhost:1880/date to use your WS-REST API. | ||
+ | |||
+ | **Advanced Exercice**: write your own REST server that gets an MQTT topic and provides it through a web service API. // You can extend a past lab MQTT example to do that//. | ||
- | **Advanced Exercice**: write your own REST server that getw an MQTT topic and provide it through a web service API. // you can extend a past lab MQTT example to do that//. | ||
Ligne 74: | Ligne 75: | ||
== Get started with WS-SOAP == | == Get started with WS-SOAP == | ||
- | == WS-SOAP in Node-Red == | + | http://www.dataaccess.com/ provide a list of WS-SOAP. |
+ | The main initial difference between WS-REST and WS-SOAP was the explicit description of the WS-SOAP API in a WSDL format (Web Service Descrition Language). | ||
+ | ** Question**: Thanks to <code> http://www.dataaccess.com/webservicesserver/NumberConversion.wso?WSDL </code> URI, display this description for NumberConversion WS-SOAP. | ||
+ | Look at the different part of this XML file to understand the corresponding SOAP API. | ||
+ | Test this WS-SOAP with <code>http://www.dataaccess.com/webservicesserver/NumberConversion.wso?op=NumberToWords</code> | ||
- | * Exercice: write your own client programm of a SOAP web service and node-red-contrib-soap package [[https://flows.nodered.org/node/node-red-contrib-soap|SOAP web service]]. | + | == WS-SOAP in Node-Red == |
- | * Use GetGeoIP [[http://www.webservicex.net/geoipservice.asmx|SOAP Web Services]] to easily look up countries by IP addresses. | + | |
- | * Exercice: test your own soap server with // npm install node-red-contrib-soapserver// (see [[https://www.npmjs.com/package/node-red-contrib-soapserver| ]]). | + | **Soap client** |
- | ** Soap server Usage ** | + | **Exercice:** Create a WS-Soap Client to test your own WS-Soap server : <code>http://www.dataaccess.com/webservicesserver/NumberConversion.wso?op=NumberToWords</code> |
- | This package provides a node that can be used to start a Node-RED flow. The node is called soap server and listens on a configurable TCP port on the host on which Node-RED run. It is important that the port number be supplied as there is no default assumed. The listener is listening for an incoming SOAP/HTTP request. The WSDL that describes the SOAP server can be retrieved through an HTTP GET request using the /soap?wsdl URL and query parameters. For example: ** http://<node-RED-Host>:<port>/soap?wsdl **. | + | To do that in node-red you must install two packages : |
- | The endpoint for the SOAP request is found at the same address | + | * node-red-contrib-soap |
+ | * node-red-contrib-soapserver | ||
- | <note> | + | use the manage palette to install them |
- | http://<node-RED-Host>:<port>/soap | + | |
- | </note> | + | |
- | The interface supplies one operation called startFlow which takes a single parameter as input of type string. When a client invokes that operation, a new Node-RED flow is initiated. The passed in data appears in the msg.payload property of the Node-RED message. | + | [[cours:mit_2018_2019:node_red_soap_client_correction|correction]] |
- | A Node-RED flow that starts with a soap server node should also conclude with a corresponding soap server output node. This is used to pass back a value to the original SOAP client. The string found in msg.payload is returned as the response value. | ||
- | |||
- | * Exercice: write your own soap server that get an MQTT topic and provide it on web service client request | ||
- | |||
- | == IoT Use Cases with WS-SOAP == | ||
==== SOA for IoT and CoAP ==== | ==== SOA for IoT and CoAP ==== | ||
{{ :cours:mit_2018_2019:osi-coap.png?300|}} | {{ :cours:mit_2018_2019:osi-coap.png?300|}} | ||
Ligne 123: | Ligne 121: | ||
[[https://flows.nodered.org/node/node-red-contrib-coap]] | [[https://flows.nodered.org/node/node-red-contrib-coap]] | ||
- | == IoT Use Cases with CoAP == | ||
- | ==== Advanced SOA - Service Registry ==== | ||
- | |||
- | == Get started with UDDI == | ||
- | |||
- | == UDDI in Node-Red == | ||
- | |||
- | == IoT Use Cases with UDDI == | ||
- | ==== Advanced SOA for IoT - Service Discovery Protocol ==== | ||
- | |||
- | == Get started with SSDP == | ||
- | |||
- | == SSDP in Node-Red == | ||
- | |||
- | == IoT Use Cases with SSDP == | ||
- | ==== SOA for IoT : Web Service for Device (UPnP and DPWS) ==== | ||
- | |||
- | == Get started with UPnP == | ||
- | |||
- | == UPnP in Node-Red == | ||
- | |||
- | == IoT Use Cases with UPnP == | ||
- | |||
- | == Get started with DPWS== | ||
- | |||
- | == DPWS in Node-Red == | ||
- | |||
- | == IoT Use Cases with DPWs == | ||
- | |||
- | |||
- | ====== Synthesis ======= | ||
- | |||
- | Middleware for IoT are deployed on heterogeneous IoT Plateform to provide a more homogeneous way to develop some distributed software applications. Most of the time, we distinguish four levels : IoT Devices, Edge, Fog, and Cloud. | ||
- | |||
- | **Exercice :** Find in the technical and scientific litterature some definitions and recent surveys on these concepts for IoT. Write a paper (Max 2 pages long) on this 4-levels point of view of distributed system that can then emerged like CyberPhysical Systems. | ||
- | For example you can argue : | ||
- | * why differents patterns of communication are used in this 4-levels System, | ||
- | * what are the famoust technologies for each levels | ||
- | |||
- | <note> | ||
- | This paper will be sent **To tigli@unice.fr** with ** Subject : <Your Name> IoT Paper 2019 ** as to attached files : one .zip with sources (tex/docx) and one pdf, no later than 10th of February | ||
- | </note> | ||
- | |||