cours:mit_2018_2019:soa4iotlab
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédenteDernière révisionLes deux révisions suivantes | ||
cours:mit_2018_2019:soa4iotlab [2019/01/29 06:02] – [SOA for IoT and WS-SOAP] tigli | cours:mit_2018_2019:soa4iotlab [2019/02/04 16:24] – [SOA for IoT and WS-SOAP] tigli | ||
---|---|---|---|
Ligne 20: | Ligne 20: | ||
[[https:// | [[https:// | ||
- | |||
Curl is mainly used to send/ | Curl is mainly used to send/ | ||
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:// | 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:// | ||
- | **Exercice**: | + | Look at a "text to speech" |
+ | |||
+ | **Exercice**: | ||
**Question**: | **Question**: | ||
Ligne 53: | Ligne 54: | ||
{{: | {{: | ||
- | |||
- | |||
** 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 |
- 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:// | + | |
+ | | ||
+ | |||
+ | **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 73: | Ligne 74: | ||
== Get started with WS-SOAP == | == Get started with WS-SOAP == | ||
+ | |||
+ | http:// | ||
+ | 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 < | ||
+ | Look at the different part of this XML file to understand the corresponding SOAP API. | ||
+ | Test this WS-SOAP with < | ||
== WS-SOAP in Node-Red == | == WS-SOAP in Node-Red == | ||
+ | **Soap client** | ||
- | | + | **Exercice:** Create a WS-Soap Client to test your own WS-Soap server |
- | * 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 | + | To do that in node-red |
- | ** Soap server | + | * node-red-contrib-soap |
+ | * node-red-contrib-soapserver | ||
+ | |||
+ | use the manage palette to install them | ||
+ | |||
+ | [[cours: | ||
+ | |||
+ | ** Soap server ** | ||
+ | |||
+ | ** Exercice**: Create your own soap server with // npm install node-red-contrib-soapserver// | ||
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 < | 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 < | ||
Ligne 100: | Ligne 117: | ||
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. | 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 | ||
- | == IoT Use Cases with WS-SOAP | + | **Soap client** |
+ | |||
+ | **Exercice: | ||
+ | |||
+ | ** Advanced Exercice**: write your own soap server that get an MQTT topic and provide it on web service client | ||
==== SOA for IoT and CoAP ==== | ==== SOA for IoT and CoAP ==== | ||
{{ : | {{ : |
cours/mit_2018_2019/soa4iotlab.txt · Dernière modification : 2019/02/05 06:57 de tigli