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.

Slides:



Advertisements
Similar presentations
Session 6 Module 2 Calling a Web Service from an ASP.NET Web Page.
Advertisements

Setting Up a Peer-to-Peer Network For Each PC –Install the Client for Microsoft Networks –This supports peer-peer networking Implement Sharing –In the.
11 Getting Started with ASP.NET Beginning ASP.NET 4.0 in C# 2010 Chapters 5 and 6.
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview Introduce Visual Studio 2013 Create a first ASP.NET application.
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
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.
Adding a Syllabus Link. Let’s add the syllabus to the homepage. Return to the homepage Click “Add File” To get to the homepage, click the Course Content.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
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 Chapter 20 — Creating Web Projects Microsoft Visual Basic.NET, Introduction to Programming.
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.
Configuring Active Directory Certificate Services Lesson 13.
1 of 5 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Microsoft Visual Basic 2005 CHAPTER 12 Cell Phone Applications and Web Services.
ASP.Net, Web Forms and Web Controls 1 Outline Introduction Simple HTTP Transaction System Architecture Creating and Running a Simple Web Form Example Web.
Chapter 9 Web Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
Building an ASP.NET Web Application Dr. Awad Khalil Computer Science & Engineering Department AUC.
McGraw-Hill© 2007 The McGraw-Hill Companies, Inc. All rights reserved. 1-1.
9-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
XML Web Services in Visual Studio.NET Peter Ty Developer Evangelist.NET and Developer Group.
Dr. Azeddine Chikh IS444: Modern tools for applications development.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
ASP.NET The.NET Framework. The.NET Framework is Microsoft’s distributed run-time environment for creating, deploying, and using applications over the.
IT 211 Project Integration and Deployment Lab #11.
Chapter 9 Programming with Web Forms Programming In Visual Basic.NET.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
CSCI 6962: Server-side Design and Programming Web Services.
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.
CSCI 6962: Server-side Design and Programming Introduction to Active Server Pages.
McGraw-Hill © 2009 The McGraw-Hill Companies, Inc. All rights reserved. Programming with Visual Web Developer Chapter 9.
Internet Technologies and Web Application Web Services With ASP.NET Tutorial: Introduction to.
Namespaces Tonga Institute of Higher Education. Introduction to Namespaces The.Net Framework provides many classes for doing different things  File Input/Output.
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
Project Deployment IT [211 CAP] How to convert your project to a full application.
Microsoft Visual Basic 2008 CHAPTER TWELVE Cell Phone Applications and Web Services.
Using Microsoft Visual Studio 2005 Original by Suma Rao Revised by John G. McMahon ( 9/6/2008 )
1 Introduction to Web Application Introduction to Web Services.
Module 1: Working with ASP.NET. Overview Introducing ASP.NET Creating Web Forms Adding ASP.NET Code to a Page Handling Page Events Discussion: ASP vs.
Module 1: Getting Started. Introduction to.NET and the.NET Framework Exploring Visual Studio.NET Creating a Windows Application Project Overview Use Visual.
Introduction to Web Services. Examples Using a Web Service Creating a new Web Service.
Getting Started with OPC.NET OPC.NET Software Client Interface Client Base Server Base OPC Wrapper OPC COM Server Server Interface WCF Alternate.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 2.1 Test-Driving the Welcome Application 2.2.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Bookstore Application: Middle Tier Introducing Code-Behind Files, Session State.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 8 – Integrating a Database with a FrontPage.
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 Application Development Introduction. Lesson: Creating Web Forms What is a Web Form? Creating a Web Form with Visual Studio.NET.
Lesson 15 Web Services. What Are Web Services Web services are programmable and reusable, much like component software, except that they are more easily.
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.
Web Development in Microsoft Visual Studio 2013 / 2015.
.NET Mobile Application Development XML Web Services.
Chapter 29. Copyright 2003, Paradigm Publishing Inc. CHAPTER 29 BACKNEXTEND 29-2 LINKS TO OBJECTIVES Attach an XML Schema Attach an XML Schema Load XML.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Murach's ASP.NET 4.5/C#, C2© 2013, Mike Murach & Associates, Inc.Slide 1.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 12 Creating Console Applications, Understanding XML, and Creating Web Services.
ASP.NET Forms.
ASP.NET Web Controls.
Writing simple Java Web Services using Eclipse
Introduction to the Visual C# 2005 Express Edition IDE
Module 1: Getting Started
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
Web Development in Microsoft Visual Studio 2013
Presentation transcript:

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 Web services are built on open standards – such as HTTP, XML, and SOAP

Creating a Simple XML Web Service Imports System Imports System.Web.Services Public Class TemperatureService : Inherits WebService Public Function ToCelsius( TF As Double ) As Double Return ( 5/9 ) * ( TF - 32 ) End Function Public Function ToFahrenheit( TC As Double ) As Double Return ( 9/5 ) * Tc + 32 End Function End Class TemperatureService.asmx

WebService & WebMethod Attributes Public Function toCelsius(TF As Double) As Double … End Function <WebService(Description:=“Temperature Service”, NameSpace:= “ Public Class TemperatureService … End Class

Invoking an XML Web Service with HTTP-Get Convert Example:

Invoking an XML Web Service with HTTP-Post <form method="post" action="/Services/TemperatureService.asmx/ToCelsius"> Example:

To create a Web Service project 1.On the File menu, point to New, and then click Project. 2.In the New Project dialog box, select either the Visual Basic Projects or the Visual C# Projects folder. 3.Click the ASP.NET Web Service icon. 4.Change the name of the project to what you want it to be. 5.If you are not developing the Web Service on your localhost Web server, enter the address of the Web server on which you will develop the Web Service. 6.Click OK to create the project. Create a Web Service Project

When using Visual Studio.NET to create Web Services in managed code, you use a standard deployment model: you compile your project and then you deploy the resulting files to a production server. The project DLL file contains the Web Services code-behind class file (.asmx.vb or.asmx.cs) along with all other class files included in your project, but not the.asmx file itself. You then deploy this single project.dll file to the production server without any source code. When the Web Service receives a request, the project.dll file is loaded and executed. Create a Web Service Project

Accessing an XML Web Service Through a Proxy Class Step 1: Use the Wsdl.exe tool to generate the source code file for the proxy class Example: wsdl.exe /l:vb test.vb

Accessing an XML Web Service Through a Proxy Class Step 2: Compile the source code file for the proxy class Example: vbc /t:library /r:System.dll,System.Web.Services.dll,System.Xml.dll text.vb test.dll

Accessing an XML Web Service Through a Proxy Class Step 3: Copy the compiled proxy class into the ASP.Net application’s /bin directory

Using an XML Web Service Proxy Class Sub Button_Click(s as Object, e as EventArgs) Dim objTemp As New TemperatureService lblTest.Text = objTemp.ToCelsius(txtTest.Text) End Sub …

To Add a Web Reference to a Project 1.In Solution Explorer, select a project that supports adding Web references. 2.On the Project menu, choose Add Web Reference. 3.In the Add Web Reference dialog box, type the URL for the Web Service in the Address text box, and then choose the Arrow Icon. 4.Verify that the items in the Available References box are the items you want to reference in your project, and then choose Add Reference. 5.In Solution Explorer, expand the Web References folder to note the namespace for the Web reference classes that are available to the items in your project.

When accessing Web Services in managed code, a proxy class and the.NET Framework handle all of the infrastructure coding. Accessing a Web Service follows these basic steps: Locate the Web Service you want to access. Create a proxy class for the Web Service by adding a Web reference to your project. Reference the proxy class in the client code by including its namespace. Create an instance of the Web Service proxy class in the client code. Access the Web Service using the methods of the proxy. Accessing Web Services in Managed Code

To simplify the coding model, applications written in managed code use a Web reference to locally represent each Web Service. You add a Web reference to your project using the Add Web Reference dialog. This dialog box supports browsing Web addresses for a Web Service. Locating a Web Service and Adding a Web Reference

Reference the Proxy Class The generated proxy class has its own namespace associated with it, and you must add the namespace to your client application before you can create an instance of that class.

Create an Instance of the Proxy Class Before you can call any of the methods of the proxy class, you must first create an instance of that class. This process does not differ at all from creating an instance of any other class.

Access the Web Service Using the Proxy To access a Web Service method, your client application invokes either the corresponding synchronous method or asynchronous methods of the proxy object. These methods in turn do the necessary work to remote the call over the wire to call the desired Web Service method. By default, the proxy class uses SOAP to access the Web Service method, as SOAP supports the richest set of data types of the three supported protocols (HTTP-GET, HTTP-POST, and HTTP-SOAP).

To Add a New Web Service to an Existing Web Project 1.In Solution Explorer, select the project to which you want to add a Web Service. 2.On the Project menu, click Add Web Service. Alternatively, right-click the project name, point to Add and then click Add Web Service. 3.The Add New Item dialog appears. By default, the dialog box selects the ASP.NET Web Service template and supplies a name for the new Web Service in the Name box. 4.Click Open to add the Web Service to your project.

To Add an Existing Web Service to an Existing Web Project 1.In Solution Explorer, select the project to which you want to add an existing Web Service. 2.On the Project menu, select Add Existing Item. Alternatively, right-click the project name, point to Add and then click Add Existing Item. The Add Existing Item dialog box appears. 3.In the Files of type list, click Web Files. 4.Select the.asmx file for the Web Service you want to add. 5.Click Open to add the Web Service to your project.