Introduction to ASP.NET, Second Edition2 Chapter Objectives.

Slides:



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

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 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.
Building and Using Web Services with ASP.NET Rob Howard Program Manager.NET Framework Team Microsoft Corp.
CIS-764 Database Design Service-Oriented Architecture and Web-Services Binti Sepaha.
XML Web Services in Visual Studio ®.NET NameTitleCompany.
Presentation 7 part 2: SOAP & WSDL. Ingeniørhøjskolen i Århus Slide 2 Outline Building blocks in Web Services SOA SOAP WSDL (UDDI)
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.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 42 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.
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.
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.
What are Xml Web Services? 1.A Web Service simply an application that exposes a Web- accessible API. 2.Web services are a new, standard platform for building.
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.
Web service testing Group D5. What are Web Services? XML is the basis for Web services Web services are application components Web services communicate.
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.
C Copyright © 2009, Oracle. All rights reserved. Appendix C: Service-Oriented Architectures.
CIS 375—Web App Dev II Microsoft’s.NET. 2 Introduction to.NET Steve Ballmer (January 2000): Steve Ballmer "Delivering an Internet-based platform of Next.
JavaScript, Fourth Edition
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 & WCF ~ Ankit. Web services A web service is a collection of protocols and standards used for exchanging data between applications or systems.
1 HKU CSIS DB Seminar: HKU CSIS DB Seminar: Web Services Oriented Data Processing and Integration Speaker: Eric Lo.
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.
Web Services (SOAP, WSDL, UDDI) SNU OOPSLA Lab. October 2005.
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.
.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.
1.NET Web Forms Web Services © 2002 by Jerry Post.
XML Web Services Architecture Siddharth Ruchandani CS 6362 – SW Architecture & Design Summer /11/05.
Grid Chemistry System Architecture Overview Akylbek Zhumabayev.
Web Services. ASP.NET Web Services  Goals of ASP.NET Web services:  To enable cross-platform, cross- business computing  Great for “service” based.
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.
Introduction to Web Services Instructor: Dr. M. Anwar Hossain.
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.
XML and Web Services (II/2546)
Intro to dot Net Dr. John Abraham UTPA CSCI 3327.
Kemal Baykal Rasim Ismayilov
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.
Module 9: Using XML Web Services in a C# Application.
Chapter 7: Creating and Consuming XML Web Services Understanding XML Web Services Creating XML Web Services Deploying and Discovering XML Web Services.
Web Services from 10,000 feet Part I Tom Perkins NTPCUG CertSIG XML Web Services.
WSDL : Web Service Definition Language Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic.
Web Services An Introduction Copyright © Curt Hill.
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.
SOAP, Web Service, WSDL Week 14 Web site:
Introduction to Web Services Srinath Vasireddy Support Professional Developer Support Microsoft Corporation.
6.2 XML Web Services Vinod Unny Enterprise InfoTech Microsoft Regional Director, North India.
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.
WEB SERVICES.
ASP.NET Web Forms and Web Services
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.
Implementing a service-oriented architecture using SOAP
Web Services Introduction
Serpil TOK, Zeki BAYRAM. Eastern MediterraneanUniversity Famagusta
Introduction to Web Services
Presentation transcript:

Introduction to ASP.NET, Second Edition2 Chapter Objectives

Introduction to ASP.NET, Second Edition3 Overview of Web Services Web applications –Consist of a client, the browser, and a Web server Remote Procedure Call (RPC) –Was used to call another application on the Web server Web Service –Part or all of a Web application that is publicly exposed so that other applications can interact with it. The code itself is not exposed, the interface is –Accessible through standard Web protocols –Platform independent

Introduction to ASP.NET, Second Edition4 Overview of Web Services (continued) Browser –Is a client of the Web application. –Does not know the Web server communicates with a Web service Web Server = Web Service Client –Delivers content to a browser –Does not know that the Web Service is communicating with any back-end applications or data sources

Introduction to ASP.NET, Second Edition5 Overview of Web Services (continued) WSDL Proxy Class –Web Service Description Language (WSDL) Web Service client application –Does not communicate directly with the Web Service –creates a WSDL proxy Class that is used to invoke the Web service Will communicate with the Web service application through a WSDL stub

Introduction to ASP.NET, Second Edition6 Overview of Web Services (continued) WSDL stub –Purpose - to make the communication with the Web service application simpler and transparent –Code that communicates between proxy class and Web service application –Knows what can be sent into and out of the Web service application WSDL proxy and stub created: –Manually - WSDL command line utility (wsdl.exe) –Automatically - Visual Studio.NET

Introduction to ASP.NET, Second Edition7 Overview of Web Services (continued) Communication Protocol and Message Format Messages and data are: –Sent back and forth across the a TCP/IP network –Formatted using XML standards so both applications can understand them –Modified to be sent over the Internet using HTTP –Packaged in an envelope using Simple Object Access Protocol (SOAP)

Introduction to ASP.NET, Second Edition8 Overview of Web Services (continued)

Introduction to ASP.NET, Second Edition9 Applying Web Services to Business Applications Scraping –Process of using a program to view a Web site and capture the source code Samples –Stream data - stock quotes or weather forecast –Real-estate database search application –Human Resource Management Web Service –Bookstore Catalogue Web Service –Community Service Directory Web Service

Introduction to ASP.NET, Second Edition10 Using Visual Studio.NET to Create and Consume Web Services Web Services - the core of the Microsoft.NET vision –Microsoft and IBM worked together to create the XML Web Services standards Web Services can be created using a variety of developer tools and programming languages Business-to-Business Sample Web Service –Tara Store Creates a Web Service to provides product data –MaryKate’s Housewares Integrates product data into its own Web site

Introduction to ASP.NET, Second Edition11 Building and Consuming a Web Service

Introduction to ASP.NET, Second Edition12 Building a Web Service Web Service file extentions –.asmx and.asmx.vb for the code behind the page Three major components –Web Service on the server –Web Service client application that calls the Web Service via a Web reference –A WSDL Web Service description document that describes the functionality of the Web Service Import System.Web.Services namespace

Introduction to ASP.NET, Second Edition13 Locating Web Services Need to locate the WSDL document –Web Service creates the WDSL document –Contains the information on how to interact with the Web Service, how to format and send data Web Service Discovery Directory –A third-party directory service –Universal Description, Discovery, and Integration (UDDI)

Introduction to ASP.NET, Second Edition14 Locating Web Services (continued) Web Discovery Service File –File extension.DISCO –Points to all of the Web Services within your application Obtain URL of WSDL from Web site owner

Introduction to ASP.NET, Second Edition15 Locating Web Services (continued)

Introduction to ASP.NET, Second Edition16 The Proxy Class Web Service client application –Does not call the Web Service class directly –Uses WSDL to create a proxy class XML-based request and response messages delivered using HTTPGet, HTTPPost, SOAP SOAP –SOAP calls are remote function calls that invoke method executions on Web Service components –Proxy class creates the SOAP envelope –Soap envelope – a wrapper around the messages and provides information about the message format

Introduction to ASP.NET, Second Edition17 Web Services Standards and Protocols HTTP protocol – can be used to deliver documents through proxy servers and firewalls –Pass parameters with a QueryString using HTTPGet –HTTPPost passes parameters as a URL-encoded string, which contains form field names and values attached to the body of the message –SOAP default message by which ASP.NET internally calls a Web Service

Introduction to ASP.NET, Second Edition18 The SOAP Contract Simple Object Access Protocol (SOAP) –Standard maintained by WC3 –XML-based protocol used for messaging delivery –Language independent and platform independent SOAP message –Is a remote procedure call over HTTP using XML A simple protocol for publishing available services

Introduction to ASP.NET, Second Edition19 The SOAP Contract (continued) Soap contract –XML-formatted document called the WSDL –Describes the interface to the Web Service –View the SOAP contract by opening a browser and typing the URL of the Web Service followed by “?WSDL” –Uses the XML language to describe the location and interfaces that a particular service supports WSDL utility looks at the contract and generates the proxy class based on the contract

Introduction to ASP.NET, Second Edition20 The SOAP Contract (continued) DISCO (discovery) document –Is not the SOAP contract –A pointer to the location of the Web Services within the Web project –An XML document that examines the SOAP contract to describe the method and data formats within the Web Service –Describes how the proxy class should make calls to the Web Service disco.exe utility to create the discovery document

Introduction to ASP.NET, Second Edition21 Creating a Web Service Visual Studio.NET –Generates WSDL document, DISCO document, test Web page WebService keyword – before the class declaration –Use WebService, if import namespace System Web.Services –Namespace property Identifies a unique URL; distinguish your Web Service from others Default domain tempuri.org Replace with your companies domain name –Description property Used to provide information about your Web Service Can use HTML commands –Name property Name displayed in the Web Service home page.

Introduction to ASP.NET, Second Edition22 Creating a Web Service (continued) <System.Web.Services.WebService _ (Namespace:=" _ Description:=  " Displaying Data from the  Tara Store Database ", _ Name:="Chapter 11 Web Service")> _ Public Class ServerVariables... End Class

Introduction to ASP.NET, Second Edition23 Creating a Web Service (continued) WebMethod –Expose one or more methods or functions –BufferResponse property Store the response on the server until the entire function is processed True will improve your server performance - minimizes communication –CacheDuration property How long to cache results from the Web service - seconds Automatically cache the results for each unique parameter –MessageName property Name for the method displayed in the Web page –Description property Can format the description with HTML

Introduction to ASP.NET, Second Edition24 Creating a Web Service (continued) <WebMethod(CacheDuration:=10, _ Description:=  "GetCat() returns the category list  for the main menu.")> _ Public Function WS_GetCat() As DataSet Dim MySQL As String = "SELECT * FROM Categories" Dim objCM1 As New  OleDbDataAdapter(MySQL, OleDbConnection1) Dim objDS1 As New DataSet objCM1.Fill(objDS1, "Categories") Return objDS1 End Function

Introduction to ASP.NET, Second Edition25 Creating a Web Service (continued) Create Web Service - Chapter11WebService Copy data files into the project View code in Ch11Products.vb –Connection string, Connection object, 4 functions Save, build solution View CatMenu.aspx to test database connections and the functions Modify Ch11WS_ProductsDS.asmx

Introduction to ASP.NET, Second Edition26 Creating a Web Service (continued)

Introduction to ASP.NET, Second Edition27 Previewing the Web Service Home Page View the Web Service home page in a browser – Click the hyperlink GetCatMethod() takes you to URL: – mx?op=GetCat()+Methodhttp://localhost/Chapter11WebService/Ch11WS_ProductsDS.as mx?op=GetCat()+Method Click Invoke button to test GetCatMethod() –XML document returned. XML data within a DataSet element –Top section describes data – bottom section contains the data Go Back, click hyperlink Service Description –View the service contract –Service Description URL - ?WSDL append to Web Service URL –

Introduction to ASP.NET, Second Edition28 Creating a Web Service (continued)

Introduction to ASP.NET, Second Edition29 Creating a Web Service (continued)

Introduction to ASP.NET, Second Edition30 Creating a Web Service (continued)

Introduction to ASP.NET, Second Edition31 Creating a Web Service (continued)

Introduction to ASP.NET, Second Edition32 Using a Web Service Call Web Services via: –HTTP Get, Post Limit to primitive data types (integers, strings, arrays of primitive data types) –SOAP Send any structure, class or enumerator – DataSet

Introduction to ASP.NET, Second Edition33 Using a Web Service (continued) Send information over Internet, packaged in a format that can travel over a TCP/IP network –Serialization - changing an object into a form that can be readily transported over the network –Deserialization - change the string back into the original structure If the document is in XML format –Use LoadXML method of the XML Document Object Model (DOM) to retrieve the XML data

Introduction to ASP.NET, Second Edition34 Consuming a Web Service from an ASP.NET Page MaryKate’s Housewares, which wants to distribute Tara Store’s products on its Web site Create Chapter11 Web application –Copy image folder and data files Add Web Reference – uctsDS.asmxhttp://localhost/Chapter11WebService/Ch11WS_Prod uctsDS.asmx

Introduction to ASP.NET, Second Edition35 Consuming a Web Service from an ASP.NET Page (continued)

Introduction to ASP.NET, Second Edition36 Consuming a Web Service from an ASP.NET Page (continued)

Introduction to ASP.NET, Second Edition37 Consuming a Web Service from an ASP.NET Page (continued)

Introduction to ASP.NET, Second Edition38 Consuming a Web Service from an ASP.NET Page (continued) Modify Ch11DisplayProducts.aspx Dim MyDS As New DataSet Dim MyService As  Chapter11.localhost.Chapter11WebService = _ New Chapter11.localhost.Chapter11WebService MyDS = MyService.WS_GetProducts(ProdID) MyProdList.DataSource = _ MyDS.Tables("Products").DefaultView MyProdList.DataBind()

Introduction to ASP.NET, Second Edition39 Consuming a Web Service from an ASP.NET Page (continued)

Introduction to ASP.NET, Second Edition40 Locating Web Services UDDI - directory service for registering and searching for Web Services Third-party Web Services – – – – Local Web Services –Discovery document points to Web Services

Introduction to ASP.NET, Second Edition41 Locating Web Services (continued)

Introduction to ASP.NET, Second Edition42 Locating Web Services (continued)

Introduction to ASP.NET, Second Edition43 Securing Web Services Traditional methods –Secure Sockets Layer (SSL) protocol To encrypt data sent using the HTTP protocol –Web Server authentication tools in IIS To change access permissions –Windows NTFS (Windows NT File System) file or directory security To protect Web Service page

Introduction to ASP.NET, Second Edition44 Securing Web Services (continued) Web Service Enhancements – WSE 2.0 –Includes bug fixes and security tools to protect the Web Services and simplify deployment of secure Web services. Protect the page with NTFS and Windows authentication

Introduction to ASP.NET, Second Edition45 Summary Web Services expose part or all of an application Web Service ends in.asmx is used to identify the methods exposed WSDL schema is used to create a WSDL document that describes the functionality of the Web Service UDDI is used to locate Web Services Web Services may be called by the HTTPGet, HTTPPost, or by SOAP

Introduction to ASP.NET, Second Edition46 Summary (continued) WSDL creates a proxy class to invoke the Web Service The SOAP contract is an XML formatted document called the WSDL The Test page uses the HTTPGet method to test the Web Service Secure Web Services with traditional methods such as IIS Web Security, HTTPS with SSL, Windows authentication, and Passport authentication