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.

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)
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
2006 IEEE International Conference on Web Services ICWS 2006 Overview.
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.
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.
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 Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
.NET Fundamentals ASP.NET Web Services December 11, 2003.
.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.
Understanding Web Applications Lesson 4. Objective Domain Matrix Skills/ConceptsMTA Exam Objectives Understanding Web Page Development Understand Web.
Web Services from 10,000 feet Part I Tom Perkins NTPCUG CertSIG XML Web Services.
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.
Software Architecture Patterns (3) Service Oriented & Web Oriented Architecture source: microsoft.
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
Distributed System using Web Services
Presentation transcript:

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 can interact with it. The code itself is not exposed, the interface is – Accessible through standard Web protocols – Platform independent Remote Procedure Call (RPC) – Used to call another application on the Web server

Overview of Web Services (Page 2) 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 Web Service is communicating with any back-end applications or data sources

Overview of Web Services (Page 3) 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

Overview of Web Services (Page 4) 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

Overview of Web Services (Page 5) 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)

Overview of Web Services

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

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 A sample "Business-to-Business" Web Service – Tara Store Creates a Web Service which provides product data – MaryKate’s Housewares Integrates product data into its own Web site

Building and Consuming a Web Service

Building a Web Service Web Service file extentions –.asmx and.asmx.vb for the code behind the page Import System.Web.Services namespace Three major components 1. Web Service on the server 2. Web Service client application that calls the Web Service via a Web reference 3. A WSDL Web Service description document that describes the functionality of the Web Service

Locating Web Services (Page 1) 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)

Locating Web Services (Page 2) 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

Locating Web Services (continued)

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

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 (Simple Object Access Protocol) is default method by which ASP.NET internally calls a Web Service

The SOAP Contract (Page 1) 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

The SOAP Contract (Page 2) 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

The SOAP Contract (Page 3) 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

Creating a Web Service (Page 1) To create the WebService document: 1. Select Project from the menu bar 2. Select WebService… from the Project menu 3. Verify that "WebService" is the selected Template, give it a name (i.e. "ServiceTSCategories") and click the button Keyword WebService comes before class header – Statement is part of the class header – Must be qualified if the System.Web.Services namespace is not imported

Creating a Web Service (Page 2) Properties for the keyword WebService: – Namespace property Unique URL which distinguishes your Web Service from others (default domain is "tempuri.org") Replace with your organization’s domain name – Description property Used to provide information about your Web Service Can include HTML commands – Name property Name displayed in the Web Service home page.

Creating a Web Service (Page 3) Example: <System.Web.Services.WebService _ (Namespace:=" _ Description:=" Displaying Data from the Tara Store Database ", _ Name:="Chapter 11 Web Service")> _ Public Class ServerVariables... End Class

Creating a Web Service (Page 4) In Visual Studio.NET compiling the Web Service generates the WSDL document, DISCO document and test Web page

The Web Method (Page 1) Create new function in "Code Behind the Page" – Exposes the method to applications in which the WebService is instantiated Keyword WebMethod comes before class header – Statement is part of the function header – Must be qualified if the System.Web.Services namespace is not imported (like WebService)

The Web Method (Page 2) Properties in statement prior to method header: – BufferResponse property Store the response on the server until the entire function is processed If set to True, improves server performance by minimizing communication – CacheDuration property Number of seconds to cache Web service results Automatically cache the results for each unique parameter

The Web Method (Page 3) Properties before method header (con): – MessageName property Name for the method displayed in the Web page Uses the name of the function or method if this property is not included – Description property Can format the description with HTML

The Web Method (Page 4) Example: <WebMethod(CacheDuration:=10, _ Description:="HelloWorld() says hello.")> _ Public Function HelloWorld() As String Return "Hello World" End Function

The Web Method

Previewing the Web Service Home Page (Page 1) View the Web Service home page in a browser – Click the hyperlink GetCatMethod() takes you to URL: – asmx?op=GetCat () +Method asmx?op=GetCat () +Method Click the button to test GetCatMethod () – XML document returned (XML data within a DataSet element) – Top section describes data; bottom section contains data

Previewing the Web Service Home Page (Page 2) Go, enter hyperlink for Service Description – View the service contract – Service Description URL – "?WSDL" is appended to Web Service URL –

Creating a Web Service

Create a New Web Method

Using a Web Service (Page 1) Call Web Services via protocol: – HTTP Get or HTTP Post Limit to primitive data types (integers, strings, arrays of primitive data types) – SOAP (Simple Object Access Protocol) Send any structure, class or enumerator, i.e. a DataSet

Using a Web Service (Page 2) 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

Consuming a Web Service from an ASP.NET Page (Page 1) In Web Form application, add a Web Reference in Solution Explorer 1. Select Project from the menu bar 2. Select Add Web Reference… from the Project menu (or right-click "Web References" in Solution Explorer) 3. Find or enter the Web Service URL, i.e. asmxhttp://localhost/Chapter11WebService/Ch11WS_ProductsDS. asmx 4. Give the reference a Web reference name: 5. Click the button

Consuming a Web Service from an ASP.NET Page

Create an object from the Web Service reference Call a WebMethod of the Web Service Example: Dim dsProducts As New DataSet Dim objWebService As localhost.Chapter11WebService = New localhost.Chapter11WebService dsProducts = objWebService.WS_GetProducts() dgProdList.DataSource = dsProducts.Tables(0) dgProdList.DataBind() Consuming a Web Service from an ASP.NET Page (Page 2)

Consuming a Web Service from an ASP.NET Page

Create a new WebForm—WebForm2.aspx Add a DataGrid— – ID--dgCategories

Consuming a Web Service from an ASP.NET Page

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

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

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