====== Service oriented computing and web services 2019 ====== ====== General Informations ====== Dates : Feb 2019 - May 2019 ECTS : 2 Lecturer : Jean-Yves Tigli Number of Students : 39 [[cours:SocWS2019:Agenda|Agenda]] ---- ==== Continuous Student Assessment and Labs Environment ==== == MCQ (Multiple choice questionnaire) == * During some sessions, MCQ will be submitted to student. == Rules for the final evaluation == * Any grade mustn't be more than 50 % the final grade * The final evaluation must consist in 2 grades at least == Student Project Evaluation == * During this course, students groups have to developp step by step a complete project using a web service architecture. * The groups production will be deposited in the groups GitHubs * Projects Documentation will be detailed in the GitHub Wiki * A group is no more than two students. * Students of a same group will be assessed separatly. == Project Github == * Each group must create a github repository and send an invitation to tigli@unice.fr. * Each group send an email to tigli@unice.fr, with [GITHUB SoCWS 2019 Labs][] with your GitHub address ** Deadline ** : 20 of March 2019 == Environment for the Introduction labs == * Because this course follows the SI3 socket programming course, you can still use Python programming language. == Virtualized environment for the second part Labs == * For client Only some services clients can run on your PC in native mode. Nevertheless most of the time, Web clients are more adapted for portability thanks to web browsers. Indeed Web browsers can run on a mobile phone, PC, interactive terminal and so on... * Servers must run on systems that are always available. Generaly they are installed in virtualized computer to be deployed easily (continuous delivery) from a computer to another, in a datacenter (in the Fog) or in a IAAS (in the cloud). ===== Project Evaluation Instructions ===== SEE THESE PAGES for YOUR PROJECT : /* {{ :cours:donelogo.gif?75|}} */ [[cours::WS-REST_and_WS-SOAP:Lab| SoCWS project guidelines]] ======= PART I : Introduction to the Web ======= Historically (until 2017), //Introduction to the Web// was licence / SI3 course. Because of the required background on the Web to study Web Service Technologies (at least to also understand the Web popularity), in 2019, this introduction is coming back in this course. [[cours:socws2019:intro_web_2019|Web Introduction]] ====== PART II : Web Services ======= ===== Session 1 : Design, Deploy and Orchestrate Services - Software Environment Tools for this Module ===== ---- ==== Introduction to the Web Services ==== || /* {{ :cours:donelogo.gif?75|}} */ * Where Web Services are coming from ? {{:cours:cours_intro_services_web_rest_et_soap_si3_2016-2017.pdf| Introduction to Web Services in SI3 : WS-REST and WS-SOAP/WSDL }} /* {{ :cours:donelogo.gif?75|}}*/ === Lecture 1 :=== || * [[cours::service_oriented_computing_and_web_services_2017_2018:lecture1| Software Tool to Design Client Applications for Web Services (Visual Studio IDE)]] /* {{ :cours:donelogo.gif?75|}} */ === Optional Lecture 2 :=== || * [[cours::service_oriented_computing_and_web_services_2017_2018:lecture2| Software Tool to Deploy WS SOAP/WSDL Client Application on Docker with Visual Studio ]] === Optional Lecture 3 === * [[cours::service_oriented_computing_and_web_services_2017_2018:lecture3| Orchestrate services with Node RED ]] ===== Session 2 : REST and SOAP Web Services ===== ---- /*{{ :cours:donelogo.gif?75|}} */ === lecture 1 == * [[cours::WS-REST_and_WS-SOAP:lecture1| Web Service REST and tutorial with VS]] * First definition of Representational State Transfer (REST)[[https://www.ics.uci.edu/~fielding/pubs/dissertation/fielding_dissertation.pdf|Architectural Styles and the Design of Network-based Software Architectures - Ph.D. DISSERTATION of Roy Thomas Fielding, 2000 ]] || /*{{ :cours:donelogo.gif?75|}} */ ** Comment CRUD and REST ** [[https://www.bmc.com/blogs/rest-vs-crud-whats-the-difference/#|REST vs CRUD: What’s The Difference?]] === lecture 2a == * [[cours::WS-REST_and_WS-SOAP:lecture2| Web Service SOAP and tutorial with VS]] === lecture 2b : WS-REST and WS-SOAP Lab and Evaluation == Before le 14-04-19 23:59:59, depose both lab WS-REST and WS-SOAP on your GitHub. From 15-04-19, some of these labs might be evaluated. ===== Session 3 : Windows Communication Fundation (WCF) and ABC model ===== ---- === Lecture 1 : Introduction to ABC Model === ||| /* {{ :cours:donelogo.gif?75|}} */ * {{:cours:6._services_-_modele_abc_-_wcf-2015-2016.pdf|Introduction to ABC Model of Microsoft}} /* {{ :cours:donelogo.gif?75|}} */ == Lab 1 : "A" means Address == * [[cours:app_rep_orientees_service_2016_2017:lab_Address|Tutorial on Address]] == Lab 2 : "C" means Contract == * [[cours:app_rep_orientees_service_2016_2017:lab_Contract|Tutorial on types of Contract]] == Lab 3 : "B" means Binding == * [[cours:app_rep_orientees_service_2016_2017:lab_ABC|Tutorial on Bindings]] /* {{ :cours:donelogo.gif?75|}}*/ === Advanced Lecture on ABC and WCF === == Types of Asynchronous Operations in WCF services == All service contracts in WCF, no matter the parameters types and return values, use WCF attributes to specify a particular message exchange pattern between client and service. WCF automatically routes inbound and outbound messages to the appropriate service operation or running client code. The client possesses only the service contract, which specifies the message exchange pattern for a particular operation. Clients can offer the developer any programming model they choose, so long as the underlying message exchange pattern is observed. So, too, can services implement operations in any manner, so long as the specified message pattern is observed. The independence of the service contract from either the service or client implementation enables the following forms of asynchronous execution in WCF applications: * Clients can invoke request/response operations asynchronously using a synchronous message exchange. * Services can implement a request/response operation asynchronously using a synchronous message exchange. * Message exchanges can be one-way, regardless of the implementation of the client or service. [[https://docs.microsoft.com/fr-fr/dotnet/framework/wcf/synchronous-and-asynchronous-operations|Find here details on the different types of Asynchronous Operations in WCF services]] == System.ServiceModel Namespace == App.config is an XML file to set a list of parameters required to instanciate some classes of the System.ServiceModel Namespace. [[https://docs.microsoft.com/fr-fr/dotnet/api/system.servicemodel?view=netframework-4.8|Find the System.ServiceModel Namespace description here and some complete source code instead of App.config configurations]] == non-http binding for non web based services : netTcpBinding == ABC Model is not only dedicated to Web Service but can use non over http binding like direct TCP/IP protocol. One of the standard Binding for that is netTcpBinding. [[https://docs.microsoft.com/fr-fr/dotnet/framework/wcf/feature-details/intranet-unsecured-client-and-service#client| Step by step tutorial to create a netTcpBinding Service]] Here you can see that the App.config file is only an other way to defined different parameters required by the Service/Client Constructor. == WCF Hosting == WCF service cannot exist on its own; it has to be hosted in windows process called as host process. Single host process can host multiple servers and same service type can be hosted in multiple host process. There are mainly four different way of hosting the WCF service. * IIS hosting * Self hosting * Windows Activation Service * Windows Service [[http://www.wcftutorial.net/WCF-Hosting.aspx|For more details and examples]] == ABC Model Extensibility == Lot of parameters are generaly predefined and precomputed on WCF projects. Anyway everything can be tuned to a new required configuration. Here find most of the possible extensions : [[https://docs.microsoft.com/fr-fr/dotnet/framework/wcf/samples/extensibility|WCF Extensibility]] ===== Session 4 : MEX and Web Services and WSDL ===== ---- ||| === Lecture 1 : ABC Model and MEX Contract === ||| Windows Communication Foundation (WCF) provides a rich infrastructure for exporting, publishing, retrieving, and importing service metadata. WCF services use metadata to describe how to interact with the service's endpoints so that tools, such as Svcutil.exe, can automatically generate client code for accessing the service. === Lecture 2 : WSDL and Web Services === ||| {{:cours:3._contrats_et_description_de_web_services_-_wsdl-2016-2017.pdf| WSDL, Web Service Description Language for WS-SOAP}} /* * {{:cours:td4-td_services_metadata_exchange_.net-2016-2017.pdf| Tutorial WSDL for WS-SOAP sous WCF- Windows Communication Foundation}} */ === TIPS === [[https://www.c-sharpcorner.com/UploadFile/dhananjaycoder/dealing-multiple-endpoints-of-a-wcf-service499/|Sample with one Mex endpoint for multiple endpoints with different contracts in a service]] ===== Advanced Session 1 : Event Based Communication and Architecture with web services ===== ---- ||| === Lecture & Lab 1 === /* {{ :cours:donelogo.gif?75|}} */ The event-driven messaging is a design pattern, applied within the service-orientation design paradigm to enable the service consumers, which are interested in events that occur within the periphery of a service provider, to get notifications about these events as and when they occur without resorting to ** the traditional inefficient polling based mechanism **. // Events allow the client or clients to be notified about something that has occurred on the service side. // W3C consortium propose a [[https://www.w3.org/Submission/WS-Eventing/|Web Services Eventing (WS-Eventing) - W3C Recommendation]] ** Tutorial ** [[cours:service_oriented_computing_and_web_services_2017_2018: Lab_eventing_and_WSTutorial : publish / subscribe pattern for eventing with web services|]] === Lab 2 === /*{{ :cours:donelogo.gif?75|}} */ || * [[cours::WS-REST_and_WS-SOAP:Eventing_Lab2| Web Service and Event driven architecture Lab 2 ]] ===== Advanced Session 2 : Web Services in IoT ===== ---- === gSOAP Introduction and Tutorial === [[cours:service_oriented_computing_and_web_services:2017-2018:gSOAP|gSOAP]] === gSOAP for web of Things : Example Raspberry Pi and Raspbian === || ** Raspberry Pi ** is a series of small single-board computers developed in the United Kingdom by the Raspberry Pi Foundation to promote the teaching of basic computer science in schools and in developing countries. The original model became far more popular than anticipated,selling outside its target market for uses such as robotics. {{ :cours:420px-raspberry_pi_3_model_b.jpg?300 |}} {{ :cours:bazaar580409_img_4051aa.jpg?100|}} ** Raspbian ** is a free operating system based on Debian optimized for the Raspberry Pi hardware. An operating system is the set of basic programs and utilities that make your Raspberry Pi run. However, Raspbian provides more than a pure OS: it comes with over 35,000 packages, pre-compiled software bundled in a nice format for easy installation on your Raspberry Pi. == Test of gSOAP on Raspbian == Install a Raspbian OS in docker container and test the previous calc WS-SOAP. === Advanced Questions : hindsight issues about Web Services === Please look at different comments in this page [[cours:service_oriented_computing_and_web_services:2017-2018: excerpts from the literature on web service, questions and answers]], and provide your best analysis with your own explanations and/or illustrations. === Optional question : Docker on RaspberryPi === Docker can also be a way to easily deploy some solutions on RaspberryPi. Of course, first thing to do is to install Docker on Raspberry Pi ... but that works ([[https://blog.hypriot.com/getting-started-with-docker-and-windows-on-the-raspberry-pi/|Example]]). ===== Other Documents and References ===== ---- || === Pattern Cache-Aside === [[https://docs.microsoft.com/fr-fr/azure/architecture/patterns/cache-aside| Microsoft C# Modèle Cache-Aside]] || === DevOps === [[cours::service_oriented_computing_and_web_services_2017_2018:advancedlecture1| DevOps Workflow for Docker Applications and Microsoft Tools]] || === Google Elevation Map === {{:cours:td6-td_wsdl_puis_ws_google.pdf|Google Elevation Map Web Service and Velib WS }} === Docker Application Lifecycle === Cloud References, [[https://novacontext.com/containerized-docker-application-lifecycle-with-microsoft-platform-and-tools/|Containerized Docker Application Lifecycle with Microsoft Platform and Tools]] === Popular Web Services === [[cours:service_oriented_computing_and_web_services_2017_2018:set_WS_providers|Set of most used Web services]] ---- ===== Archives ===== ---- * [[cours:app_rep_orientees_service_2016_2017|Applications Réparties : du Web, Web Services au Services (SI4)]] ===== FAQ ===== ---- * [[cours:service_oriented_computing_and_web_services_2017_2018:FAQ|]]