OE-NIK HP Advanced Programming Web services Standards and protocols Using web services Using web services with asynchronous calls.

Slides:



Advertisements
Similar presentations
Oct, 26 th, 2010 OGF 30, NSI-WG: Network Service Interface working group Web Services Overview Web Services for NSI protocol implementation
Advertisements

18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services.
Web Service Architecture
Siebel Web Services Siebel Web Services March, From
Intesar G Ali IT DepartmentPalestinian Land Authority Web services Prepared by: Intesar Ali IT Department PLA August 2010.
Web Service Ahmed Gamal Ahmed Nile University Bioinformatics Group
Introduction to WSDL presented by Xiang Fu. Source WSDL 1.1 specification WSDL 1.1 specification – WSDL 1.2 working draft WSDL.
1 Understanding Web Services Presented By: Woodas Lai.
Introduction to Web Services and Web API’s Richard Holowczak Baruch College December, 2014.
Web Services Darshan R. Kapadia Gregor von Laszewski 1http://grid.rit.edu.
Web Services Nasrullah. Motivation about web service There are number of programms over the internet that need to communicate with other programms over.
1 Introduction to XML. XML eXtensible implies that users define tag content Markup implies it is a coded document Language implies it is a metalanguage.
Latest techniques and Applications in Interprocess Communication and Coordination Xiaoou Zhang.
Windows Communication Foundation and Web Services.
A New Computing Paradigm. Overview of Web Services Over 66 percent of respondents to a 2001 InfoWorld magazine poll agreed that "Web services are likely.
Web Services CS Web Services Internet-available services using XML messaging, for computer-computer interaction Not tied to any OS or language Self-describing:
1 Web Services Visual C# 2008 Step by Step Chapter 30.
Web Service What exactly are Web Services? To put it quite simply, they are yet another distributed computing technology (like CORBA, RMI, EJB, etc.).
Web Services Michael Smith Alex Feldman. What is a Web Service? A Web service is a message-oriented software system designed to support inter-operable.
Getting Started with WCF Windows Communication Foundation 4.0 Development Chapter 1.
Web service testing Group D5. What are Web Services? XML is the basis for Web services Web services are application components Web services communicate.
Introduction SOAP History Technical Architecture SOAP in Industry Summary References.
T Network Application Frameworks and XML Web Services and WSDL Sasu Tarkoma Based on slides by Pekka Nikander.
1 HKU CSIS DB Seminar: HKU CSIS DB Seminar: Web Services Oriented Data Processing and Integration Speaker: Eric Lo.
CSCI 6962: Server-side Design and Programming Web Services.
James Holladay, Mario Sweeney, Vu Tran. Web Services Presentation Web Services Theory James Holladay Tools – Visual Studio Vu Tran Tools – Net Beans Mario.
Lecture 15 Introduction to Web Services Web Service Applications.
Web Services Week 7 Aims: A detailed look at the underlying mechanisms for communication between web services Objectives: SOAP, WSDL, UDDI.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
Web Services based e-Commerce System Sandy Liu Jodrey School of Computer Science Acadia University July, 2002.
.Net and Web Services Security CS795. Web Services A web application Does not have a user interface (as a traditional web application); instead, it exposes.
Web Services Based on SOA: Concepts, Technology, Design by Thomas Erl MIS 181.9: Service Oriented Architecture 2 nd Semester,
Web Services. ASP.NET Web Services  Goals of ASP.NET Web services:  To enable cross-platform, cross- business computing  Great for “service” based.
Web Services. Abstract  Web Services is a technology applicable for computationally distributed problems, including access to large databases What other.
Distributed Programming CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
Introduction to Server-Side Web Development Introduction to Server-Side Web Development using JSP and Web Services JSP and Web Services 18 th March 2005.
Copyright © 2013 Curt Hill SOAP Protocol for exchanging data and Enabling Web Services.
1 Web Services Web and Database Management System.
XML and Web Services (II/2546)
Kemal Baykal Rasim Ismayilov
CSIT 220 (Blum)1 Remote Procedure Calls Based on Chapter 38 in Computer Networks and Internets, Comer.
An Introduction to Web Services Web Services using Java / Session 1 / 2 of 21 Objectives Discuss distributed computing Explain web services and their.
Web Services from 10,000 feet Part I Tom Perkins NTPCUG CertSIG XML Web Services.
Web services In this presentation… –what is a web service? –web service benefits –web service standards –web service definitions –web service actions.
Web Services An Introduction Copyright © Curt Hill.
Web Technologies Lecture 10 Web services. From W3C – A software system designed to support interoperable machine-to-machine interaction over a network.
Intro to Web Services Dr. John P. Abraham UTPA. What are Web Services? Applications execute across multiple computers on a network.  The machine on which.
.NET Mobile Application Development XML Web Services.
Introduction to Web Services Presented by Sarath Chandra Dorbala.
Web Services Blake Schernekau March 27 th, Learning Objectives Understand Web Services Understand Web Services Figure out SOAP and what it is used.
SOAP, Web Service, WSDL Week 14 Web site:
OE-NIK HP Advanced Programming WCF WCF SOAP service, host, client Exception handling (NOT required)
Software Architecture Patterns (3) Service Oriented & Web Oriented Architecture source: microsoft.
A service Oriented Architecture & Web Service Technology.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 9 Web Services: JAX-RPC,
Windows Communication Foundation and Web Services
WEB SERVICES.
T Network Application Frameworks and XML Web Services and WSDL Sasu Tarkoma Based on slides by Pekka Nikander.
Unit – 5 JAVA Web Services
Windows Communication Foundation and Web Services
Implementing a service-oriented architecture using SOAP
WEB API.
Web services, WSDL, SOAP and UDDI
Serpil TOK, Zeki BAYRAM. Eastern MediterraneanUniversity Famagusta
Deepak Shenoy Agni Software
Distributed System using Web Services
Distributed System using Web Services
Presentation transcript:

OE-NIK HP Advanced Programming Web services Standards and protocols Using web services Using web services with asynchronous calls

OE-NIK HP Advanced Programming Web services Standards and protocols Using web services Using web services with asynchronous calls

V1.03 OE-NIK HP Web service A software component that provides services (methods) that is accessible through the Internet –Usually a part of a bigger system –The user (= another application) sees the service as a black-box operation –Can be accessed using well-defined interfaces Advantages –Can be accessible via standardized protocols –The communication formats are based on open standards (XML, JSON) –Independent from OS, programming language, implementation –Easy to describe and publish and use

V1.04 OE-NIK HP Service Oriented Architecture Most of the services are built using this pattern Service registry Service userService provider Search Publish Provides Uses

OE-NIK HP Advanced Programming Web services Standards and protocols Using web services Using web services with asynchronous calls

V1.0 IP-based alternatives to call a method TCP/UDP (or theoretically even ICMP) –Send and receive a sequence of bytes, must handle the format –Difficult to implement, very fast, almost zero overhead SOAP –Pre-defined SOAP XML formats to define and call the service methods and transmit various data types (array, list, object) –Arbitrary protocol to transmit the XML messages, usually HTTP –Very easy to implement, relatively slow, big overhead –We will use this one REST –Custom JSON format to transmit unique objects (rarely XML) –We rarely need complex parameters, in this case we use HTTP POST to send a JSON object (rarely XML) –Typically we only need the method name and string/int parameters, thus most of the method calls can be represented as HTTP GET requests –The answer is typically JSON (rarely XML) –Easy to implement, medium speed, medium overhead 6 OE-NIK HP

V1.0 Discovery The provider can publish the service in a registry The user can search for providers in the registry UDDI: Universal Description, Discovery and Integration –List of services –Possibility to search (service name, company name, location) –Can be private or public registry DISCO –.NET –based service discovery framework, by Microsoft None is used... –Alternative: cloud computing –We do not care about the exact location, API calls will deal with that –„Somewhere” located  the protocol is still a question 7 OE-NIK HP Discovery UDDI, DISCO Description WSDL Message SOAP Transmission HTTP, SMTP, …

V1.0 Description The user has to know –The location and the name of the service –The published methods –The message/error types used in the communication –The input parameters –The return types WSDL: Web Services Description Language –A complex XML to describe all of the above 8 OE-NIK HP Discovery UDDI, DISCO Description WSDL Message SOAP Transmission HTTP, SMTP, …

V1.0 Message SOAP: Simple Object Access Protocol Just like the WSDL, it is XML data Everything is wrapped into a “SOAP envelope” Send the request-envelope  Receive the response-envelope The creation and the processing of these envelops are completely automatic, the SOAP API libraries hide these There are SOAP API libraries for almost every programming languages! 9 OE-NIK HP Discovery UDDI, DISCO Description WSDL Message SOAP Transmission HTTP, SMTP, …

V1.0 Transmission The request-envelope has to be transmitted from the caller to the service provider The service provider decodes the envelope, executes the method, then encodes the return value into the response-envelope The response-envelope has to be transmitted from the service provider to the caller SOAP is NOT dependent on the transmission protocol! Typically (= always) we use HTTP (Hypertext Transfer Protocol) Theoretically it is possible to mix the protocols (send request in FTP, receive in SMTP) 10 OE-NIK HP Discovery UDDI, DISCO Description WSDL Message SOAP Transmission HTTP, SMTP, …

V1.0 Service calls in.NET: EVERYTHING is hidden from the programmer! 11 OE-NIK HP SOAP IIS/ASP.NET TCP/IP HTTP TCP/IP SOAP Proxy osztály Physical Link Client application Web Service Logical connection

V1.0 Windows Communication Foundation An advanced API to develop and use distributed systems/services Exists since.NET 3.0, hides the physical communication Integrates all the technologies that existed before in.NET –XML-webservices, DCOM,.NET remoting, etc... –This means: SOAP, since the beginning! –Later: REST (REST+Entity Framework: WCF Data Services!) –But NOT the native TCP/UDP communication! 12 OE-NIK HP Client applicationWCF host ProxyWCF service

OE-NIK HP Advanced Programming Web services Standards and protocols Using web services Using web services with asynchronous calls

V1.0 General approach The service user application can be any type of application (console, windows, web...) The user application cannot and will not know the implementation details of the service The exposed methods and types are all listed in the WSDL The programming environments are usually capable of generating a proxy class (and message classes) based on the WSDL file Calling a method in the proxy class = SOAP-encode, send, wait, read reply, SOAP-decode The physical implementation of the service is 100% hidden! 14 OE-NIK HP

V1.0 Using a SOAP web service in.NET We can create a proxy class by adding a service reference into the project (or manually using the svcutil.exe tool) –Menuitem: Add Service Reference –Type the service address, then click on GO –We can inspect the exposed methods of the service. Then we should specify service name, and then we can click on OK –The proxy class is added to the solution, along with other (parameter & message) classes. They are placed into the namespace projectname.servicename By calling the methods of an instance of the proxy class, we get the result just like with calling regular methods –With SOAP services, the result is usually a string that represents an XML –An XML was encoded in the SOAP envelope XML! The decoding is automatic –We can convert the string result into an Xdocument, then use LINQ to XML 15 OE-NIK HP

V1.0 Using a SOAP web service in.NET 16 OE-NIK HP

V1.017 OE-NIK HP Exercise 1. Using the web service of the Hungarian National Bank, display the current exchange rates –WSDL downloadable from: (google: mnb asmx) –Old WSDL from the hp webpage –The new WSDL (since 2015/JULY – AUG?) changes almost nothing in the service (fixes one typo in the result XML, but completely screws up the function parameters) Steps: –Add a service reference –Create an instance of the proxy class –Use the GetInfo method to get the list of supported currencies, use the GetCurrentExchangeRates method to get the current exchange rates –Put the result into a DataGrid control

V1.018 OE-NIK HP Solution

OE-NIK HP Advanced Programming Web services Standards and protocols Using web services Using web services with asynchronous calls

V1.0 Asynchronous calls When generating the proxy class, we can setup to generate threaded (non-blocking) calls –Right click on the service reference, Configure service reference... –Add Service Reference -> Advanced… -> Generate Task-based operations Task-based –An extra method named xxxAsync that returns a Task –We usually use.ContinueWith() Classic APM –An extra method named xxxAsync –An extra event named xxxCompleted –The event will be raised when the operation result arrives –The result is in e.Result 20 OE-NIK HP

V1.021 OE-NIK HP Exercise 2. Let the user specify the currencies and dates –Look out for non-existing currencies (ATS now, EUR 20 years ago) –Display the results in the same DataGrid –Using Task-based operations Steps: –Use the GetExchangeRates method –If the two dates are the same => result for that one day

V1.0 Solution 22 OE-NIK HP