INTRODUCTION TO WEB SERVICES CS 795. What is a Web Service ? Web service is a means by which computers talk to each other over the web using HTTP and.

Slides:



Advertisements
Similar presentations
18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services.
Advertisements

Introduction to Web Services Protocols. Talk titledate2 Communication and standards Efficient (or indeed any) communication is dependent on a shared vocabulary.
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
General introduction to Web services and an implementation example
Web Services Web Services are the basic fundamental building blocks of invoking features that can be accessed by an application program. The accessibility.
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.
Introduction to Web Services Yossi Amir Itzik Kasovitch.
Presentation 7 part 2: SOAP & WSDL. Ingeniørhøjskolen i Århus Slide 2 Outline Building blocks in Web Services SOA SOAP WSDL (UDDI)
Web Services Jeffrey Miller California State University Los Angeles Winter 2003.
XML Technologies and Applications Rajshekhar Sunderraman Department of Computer Science Georgia State University Atlanta, GA 30302
Slide 1 EE557: Server-Side Development Lecturer: David Molloy Room: XG19 Mondays 10am-1pm Notes:
Grid Computing, B. Wilkinson, 20043a.1 WEB SERVICES Introduction.
Chapter 11 Web Services (Code Reuse over the Internet) Yingcai Xiao.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Web Services.
XML Web Services ASP.NET. Overview of Web Services (Page 1) Web Service – Part or all of a Web application that is publicly exposed so that other applications.
Chapter 12 Extending Web Applications. ASP.NET 2.0, Third Edition2.
1 Web Services Visual C# 2008 Step by Step Chapter 30.
Web Services February 14 th, Outline Overview of web services Create a web service with MS.Net Requirements for project Phase II.
CS 415 N-Tier Application Development By Umair Ashraf July 6,2013 National University of Computer and Emerging Sciences Lecture # 9 Introduction to Web.
Processing of structured documents Spring 2003, Part 6 Helena Ahonen-Myka.
XML Web Services in Visual Studio.NET Peter Ty Developer Evangelist.NET and Developer Group.
A Scalable Application Architecture for composing News Portals on the Internet Serpil TOK, Zeki BAYRAM. Eastern MediterraneanUniversity Famagusta Famagusta.
Discovering E-Services Using UDDI in SELF-SERV Quan Z. Sheng, Boualem Benatallah, Rayan Stephan, Eileen Oi-Yan Mak, Yan Q. Zhu School of Computer Science.
Web Services Dr. Awad Khalil Computer Science & Engineering Department AUC.
1 HRS2422 Web Services JAX-WS and SOAP Introduction  Web service – A software component stored on one computer that can be accessed via method.
Web Services (SOAP, WSDL, and UDDI)
James Holladay, Mario Sweeney, Vu Tran. Web Services Presentation Web Services Theory James Holladay Tools – Visual Studio Vu Tran Tools – Net Beans Mario.
CSC8530 Distributed Systems XML Web Services David Vaglia.
Web Server Administration Web Services XML SOAP. Overview What are web services and what do they do? What is XML? What is SOAP? How are they all connected?
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.
1.NET Web Forms Web Services © 2002 by Jerry Post.
Web Services Standards. Introduction A web service is a type of component that is available on the web and can be incorporated in applications or used.
Web Services. ASP.NET Web Services  Goals of ASP.NET Web services:  To enable cross-platform, cross- business computing  Great for “service” based.
Distributed Computing with HTTP, XML, SOAP, and WSDL CHAPTER 14 MOHAMMAD BORUJERDI 1 INTERNET ENGINEERING OUTLINE : Shift in perspective from data to programs.
1 Introduction to Web Application Introduction to Web Services.
XML Web Service. Overview of XML Web Service ASP.NET XML Web services enable you to remotely access the properties and methods of classes across a network.
Copyright © 2013 Curt Hill SOAP Protocol for exchanging data and Enabling Web Services.
1 Web Services Web and Database Management System.
Enterprise Computing: Web Services
Introduction to Web Services. SOAP SOAP originally stood for "Simple Object Access Protocol". Web Services expose useful functionality to Web users through.
ASP.NET Web Services.  A unit of managed code installed under IIS that can be remotely invoked using HTTP.
Week Six : Writing Web Services Aims: Creating and Consuming student’s first Web Services Learning Outcomes: Familiarity with VS.NET for creating and consuming.
Chapter 7: Creating and Consuming XML Web Services Understanding XML Web Services Creating XML Web Services Deploying and Discovering XML Web Services.
C# 1 Web services CSC 298. C# 2 Web services  A technology to make libraries available across the internet.  In Visual Studio,  can create a web service.
Understanding Web Applications Lesson 4. Objective Domain Matrix Skills/ConceptsMTA Exam Objectives Understanding Web Page Development Understand Web.
Web services In this presentation… –what is a web service? –web service benefits –web service standards –web service definitions –web service actions.
1 10/19/05CS360 Windows Programming ASP.NET. 2 10/19/05CS360 Windows Programming ASP.NET  ASP.NET works on top of the HTTP protocol  Takes advantage.
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.
Lecture VI: SOAP-based Web Service CS 4593 Cloud-Oriented Big Data and Software Engineering.
EGEE is a project funded by the European Union under contract IST Introduction to Web Services 3 – 4 June
Net-centric Computing Web Services. Lecture Outline  What is Web Service  Web Service Architecture  Creating and using Java Web Services  Apache Axis.
SOAP, Web Service, WSDL Week 14 Web site:
Introduction to Web Services Srinath Vasireddy Support Professional Developer Support Microsoft Corporation.
Software Architecture Patterns (3) Service Oriented & Web Oriented Architecture source: microsoft.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 9 Web Services: JAX-RPC,
Java Web Services Orca Knowledge Center – Web Service key concepts.
Jim Fawcett CSE681 – SW Modeling & Analysis Spring 2005
Web Programming Developing Web Applications including Servlets, and Web Services using NetBeans 6.5 with GlassFish.V3.
Sabri Kızanlık Ural Emekçi
ASP.NET Web Forms and Web Services
Web Services CO5027.
INTRODUCTION TO WEB SERVICES CS 795. What is a Web Service ? Web service is a means by which computers talk to each other over the web using HTTP and.
Web Services Introduction
A Little Bit of Active Server Pages (ASP)
Presentation transcript:

INTRODUCTION TO WEB SERVICES CS 795

What is a Web Service ? Web service is a means by which computers talk to each other over the web using HTTP and other universally supported protocols. A Web service is an application that: Runs on a Web server Runs on a Web server Exposes Web methods to interested callers Exposes Web methods to interested callers Listens for HTTP requests representing commands to invoke Web methods Listens for HTTP requests representing commands to invoke Web methods Executes Web methods and returns the results Executes Web methods and returns the results

Web Services is based on: HTTP (Hypertext Transport Protocol) HTTP (Hypertext Transport Protocol) SOAP (Simple Object Access Protocol) SOAP (Simple Object Access Protocol) UDDI (Universal Description, Discovery and Integration) UDDI (Universal Description, Discovery and Integration) WS-POLICY (Web Services Policy) WS-POLICY (Web Services Policy) Most Web services expect their Web methods to be invoked using HTTP requests containing SOAP messages. SOAP is an XML-based vocabulary for performing remote procedure calls using HTTP and other protocols.

Sample web service Calc.asmx using System; using System.Web.Services; [WebService (Name="Calculator Web Service", Description = "Perform simple math over the Web")] class CalcService { [WebMethod (Description = "Computes the sum of two integers")] public int Add (int a, int b) { return a+b;} [WebMethod (Description = "Computes the difference between two integers")] public int Subtract (int a, int b) { return a-b;} }

The example demonstrates several important principles of Web service programming using the.NET Framework: The example demonstrates several important principles of Web service programming using the.NET Framework: Web services are implemented in ASMX files. ASMX is a special file name extension registered to ASP.NET (specifically, to an ASP.NET HTTP handler) in Machine.config. Web services are implemented in ASMX files. ASMX is a special file name extension registered to ASP.NET (specifically, to an ASP.NET HTTP handler) in Machine.config. ASMX files begin WebService directives. At a minimum, the directive must contain a Class attribute identifying the class that makes up the Web service. ASMX files begin WebService directives. At a minimum, the directive must contain a Class attribute identifying the class that makes up the Web service. Web service classes can be attributed with optional WebService attributes. The one in the previous example assigns the Web service a name and a description that show up in the HTML page generated when a user calls up Calc.asmx in his or her browser. Web service classes can be attributed with optional WebService attributes. The one in the previous example assigns the Web service a name and a description that show up in the HTML page generated when a user calls up Calc.asmx in his or her browser. Web methods are declared by tagging public methods in the Web service class with WebMethod attributes. You can build helper methods into a Web service—methods that are used internally by Web methods but that are not exposed as Web methods themselves—by omitting the Webmethod attribute. Web methods are declared by tagging public methods in the Web service class with WebMethod attributes. You can build helper methods into a Web service—methods that are used internally by Web methods but that are not exposed as Web methods themselves—by omitting the Webmethod attribute.

Testing a Web Service : How do you test an ASMX Web service? Simple: just call it up in your browser. ASP.NET responds to the HTTP request for Calc.asmx by generating an HTML page that describes the Web service. ASP.NET responds to the HTTP request for Calc.asmx by generating an HTML page that describes the Web service. The name and description in the ASMX file’s WebService attribute appear at the top of the page. The name and description in the ASMX file’s WebService attribute appear at the top of the page. Underneath is a list of Web methods that the service exposes, complete with the descriptions spelled out in the WebMethod attributes. Underneath is a list of Web methods that the service exposes, complete with the descriptions spelled out in the WebMethod attributes. Click “Add” near the top of the page, and ASP.NET displays a page that you can use to test the Add method. Click “Add” near the top of the page, and ASP.NET displays a page that you can use to test the Add method. ASP.NET knows the method name and signature because it reads them from the metadata in the DLL it compiled from Calc.asmx. It even generates an HTML form that you can use to call the Add method with your choice of inputs. ASP.NET knows the method name and signature because it reads them from the metadata in the DLL it compiled from Calc.asmx. It even generates an HTML form that you can use to call the Add method with your choice of inputs. The XML returned by the Web method appears in a separate browser window The XML returned by the Web method appears in a separate browser window The forms that ASP.NET generates on the fly from ASMX files enable you to test the Web services that you write without writing special clients to test them with. The forms that ASP.NET generates on the fly from ASMX files enable you to test the Web services that you write without writing special clients to test them with.

Suppose you write a Web service that publishes Web methods named Add and Subtract that callers can use to add and subtract simple integers. If the service’s URL is here’s how a client would invoke the Add method by transmitting a SOAP envelope in an HTTP request. This example adds 2 and 2: Suppose you write a Web service that publishes Web methods named Add and Subtract that callers can use to add and subtract simple integers. If the service’s URL is here’s how a client would invoke the Add method by transmitting a SOAP envelope in an HTTP request. This example adds 2 and 2: POST /calc.asmx HTTP/1.1 POST /calc.asmx HTTP/1.1 Host: Host: Content-Type: text/xml; charset=utf-8 Content-Length: 338 SOAPAction: <soap:Envelope xmlns:xsi=" instance" xmlns: xsd= xmlns: xsd= xmlns:soap=" xmlns:soap=" 2 2

And here’s how the Web service would respond: And here’s how the Web service would respond: HTTP/ OK HTTP/ OK Content-Type: text/xml; charset=utf-8 Content-Length: 353 <soap:Envelope xmlns:xsi= <soap:Envelope xmlns:xsi= xmlns:xsd= xmlns:xsd= xmlns:soap=" xmlns:soap=" 4 4

The Web service’s job is to parse the SOAP envelope containing the inputs, add 2 and 2, formulate a SOAP envelope containing the sum of 2 and 2, and return it to the client in the body of the HTTP response. This, at the most elemental level, is what Web services are all about. Web services written with the.NET Framework also allow their Web methods to be invoked using ordinary HTTP GET and POST commands. The following GET command adds 2 and 2 by invoking the Web service’s Add method: GET /calc.asmx/Add?a=2&b=2 HTTP/1.1 Host: The Web service responds as follows: HTTP/ OKContent-Type: text/xml; charset=utf-8Content-Length:

Here’s a POST command that adds 2 and 2: POST /calc.asmx/Add HTTP/1.1 Host: application/x-www-form-urlencodedContent-Length: 7a=2&b=2 And here’s the Web service’s response: HTTP/ OKContent-Type: text/xml; charset=utf-8Content-Length: The hard part of writing a Web service is parsing HTTP requests and generating HTTP responses. The.NET Framework insulates developers from the low-level details of HTTP, SOAP, and XML and provides a high-level framework for writing Web services and Web service clients alike. The hard part of writing a Web service is parsing HTTP requests and generating HTTP responses. The.NET Framework insulates developers from the low-level details of HTTP, SOAP, and XML and provides a high-level framework for writing Web services and Web service clients alike.

Web Services Description Language - WSDL If other developers are to consume (that is, write clients for) a Web service that you author, they need to know : If other developers are to consume (that is, write clients for) a Web service that you author, they need to know : What Web methods your service publishes What Web methods your service publishes What protocols it supports What protocols it supports The signatures of its methods The signatures of its methods The Web service’s location (URL) The Web service’s location (URL) All this information and more can be expressed in a language called the Web Services Description Language, or WSDL for short. All this information and more can be expressed in a language called the Web Services Description Language, or WSDL for short. WSDL is an XML vocabulary

Web Service Discovery—DISCO and UDDI Once a client has a WSDL contract describing a Web service, it has all the information it needs to make calls to that Web service. Once a client has a WSDL contract describing a Web service, it has all the information it needs to make calls to that Web service. But when you publish a Web service by making it available on a Web server, how do clients find out where to get a WSDL contract? For that matter, how do clients know that your Web service exists in the first place? The answer comes in two parts: The answer comes in two parts: DISCO and Universal Description, Discovery, and Integration (UDDI) DISCO is a file-based mechanism for local Web service discovery—that is, for getting a list of available Web services from DISCO files deployed on Web servers. DISCO is a file-based mechanism for local Web service discovery—that is, for getting a list of available Web services from DISCO files deployed on Web servers. UDDI is a global Web service directory that is itself implemented as a Web service. UDDI is a global Web service directory that is itself implemented as a Web service.