Web Services Introduction

Slides:



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

Intesar G Ali IT DepartmentPalestinian Land Authority Web services Prepared by: Intesar Ali IT Department PLA August 2010.
© 2009 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott COMP6325 Advanced Web Technologies Dr. Paul Walcott The University.
Building and Using Web Services with ASP.NET Rob Howard Program Manager.NET Framework Team Microsoft Corp.
Presentation 7 part 2: SOAP & WSDL. Ingeniørhøjskolen i Århus Slide 2 Outline Building blocks in Web Services SOA SOAP WSDL (UDDI)
Authenticating Users in an ASP.NET Application. Web Site Administration Tool From VS 2008, click Website/ ASP.Net Configuration to open Web Site Administration.
VB.NET Database Tools ISYS Net Applications OLE DB Provider OLE DB Data Source OLE DB Provider ODBC Data Source SQL Server Data Source SQL Server.Net.
ASP.Net AJAX. AJAX Asynchronous JavaScript and XML: – JavaScript, Document Object Model, Cascade Style Sheet, XML, server-side script such as.Net, etc.
Shopping Cart. ASP.NET State Management Session: User state Application: Application state Cache Static variables: –Public Shared interestRate as Single.
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
Web Site Security ISYS 512/812. Authentication Authentication is the process that determines the identity of a user. Web.config file – node Options: –Windows:
VB.NET Database Tools ISYS 573. Microsoft Universal Data Access ODBC: Open Database Connectivity –A driver manager –Used for relational databases OLE.
Introduction to Web Application Development with.Net and Web Service ISYS 350.
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.
Coding ADO.NET Objects: Connection, Command, DataReader.
Introduction to VB.Net Internet Tools. Web Server Default directory –C:\InetPub\wwwroot –Computer lab: Zip drive dchao Default home page –Default.aspx,
Chapter 12 Extending Web Applications. ASP.NET 2.0, Third Edition2.
Website Security ISYS 512. Cookies Data in Cookies System.Web Which web site set the cookie Expiration date –DateTime data type –TimeSpan data type One.
Web Services CS Web Services Internet-available services using XML messaging, for computer-computer interaction Not tied to any OS or language Self-describing:
Introduction to Web Service ISYS 512. Web Service XML Web Service Web services are classes that are stored on the web which can instantiate and use in.
ASP and HTML. Anchor Tag testAnchorTag Demo: ASPNet/ASPNETProdListSelf.ASPX.
Introduction to VB.Net Internet Tools. Downloading Internet Resources Download the HTML from a web page and display it in a text box. –System.URI A class.
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.
XML Web Services in Visual Studio.NET Peter Ty Developer Evangelist.NET and Developer Group.
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.
Introduction to XML and Web Service ISYS 464. HTML vs XML HTML is a language specifically designed for displaying information in browser. It doesn’t carry.
.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.
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 Web Services Instructor: Dr. M. Anwar Hossain.
Introduction to Web Service ISYS 512. Web Service XML Web Service Web services are classes that are stored on the web which can instantiate and use in.
1 Introduction to Web Application Introduction to Web Services.
ASP.Net and HTML. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load dim strConn as string ="Provider=Microsoft.Jet.OLEDB.4.0;Data.
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.
Establishing a foundation for web services Ashraf Memon.
XML Basics A brief introduction to XML in general 1XML Basics.
1 Web Services Web and Database Management System.
1 CS 3870/CS 5870: Note 20 Web Service. 2 What is Web Service? Providing functionality online to other applications, Web and Windows applications. The.
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.
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.
Introduction to XML and Web Service ISYS 512/812.
Web services In this presentation… –what is a web service? –web service benefits –web service standards –web service definitions –web service actions.
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 Srinath Vasireddy Support Professional Developer Support Microsoft Corporation.
Labs: Create, deploy and test a simple web service
Jim Fawcett CSE681 – SW Modeling & Analysis Spring 2005
Computing with C# and the .NET Framework
CS 3870/CS 5870 Web Service.
Web Programming Developing Web Applications including Servlets, and Web Services using NetBeans 6.5 with GlassFish.V3.
ASP.NET Web Forms and Web Services
How to Create a Simple Web Service and Use it in ASP.Net
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, WSDL, SOAP and UDDI
Quiz Points 4 Rules Raise your hand if you know the question
Deepak Shenoy Agni Software
Coding ADO.NET Objects: Connection, Command, DataReader
Database Handling Class and Service
Chapter 42 Web Services.
A Little Bit of Active Server Pages (ASP)
Presentation transcript:

Web Services Introduction ISYS 546

Web Service XML Web Service Web services are classes that are stored on the web which can instantiate and use in both Windows and Web applications.

Creating a Web Service Using a Text Editor WebService directive: <%@ WebService Class="CustomerInfo" %> Import namespaces: imports System.Web.Services imports System Define the web service class. Add WebMethod attribute to the function declaration. Note: Web service file extension is ASMX

A Web Service Example ASPET/TestWebService.ASMX <%@ WebService Class="CustomerInfo" %> imports System.Web.Services imports System imports System.Data imports System.Data.Oledb Public Class CustomerInfo <webMethod()> public Function GetCname(ByVal CID as String) as String dim strConn as string ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source = c:\sales2k.mdb" dim objConn as new OledbConnection(strConn) dim strSQL as string = "select * from customer where CID = '" & CID & "';" dim objComm as new OledbCommand(strSQL,objConn) dim Results as string objConn.open() dim objDataReader as oledbDataReader objDataReader=objComm.executeReader() objDataReader.read() return objDataReader("Cname") end function

Creating a Web Service Using VS New Project/ASP.Net Web Service

Web Service Description Language (WSDL) A WSDL file is an XML document containing a complete description of the web service. It shows a web service’s name, methods, and parameter types. Help page: After entering web service’s URL, a help page is displayed. You can click the Service Description link to see the WSDL file.

HTTP HTTP Request: HTTP Response: Request line: Method – Get, Post Header Body HTTP Response: Respons line: HTTP version and status code

Invoking a Web Service with HTTP Http – Get: http://dchaolaptop/aspnet/testwebservice.asmx/GetRating?cid=1 Http – Post: Use the Action attribute to call the function. Http-SOAP: Use Http’s Post method to send an XML document in Https’ body section. Demo: Help page

Simple Object Access Protocol SOAP SOAP Request and Response message: Envelop: An envelop element surrounds the message. It is the root element of a SOAP XML document. Body: Request: Contains the method call name and parameter names and values. Response: Contains the results returned by the method.

Consuming Web Services from a Windows Application Add a web reference to the web service. Declare a web service class variable. Dim myWebService As New dchaolaptop.CustomerInfo() Demo: UseWebService

Universal Description, Discovery, and Integration (UDDI) A directory service for web services. http://uddi.org

Consuming Web Services from a Web Application Creating a web service proxy class: A local representation of the web service. Steps to creating a proxy class: Use the Wsdl.exe tool to generate the source code file for the proxy class. Compile the source code file into a DLL file. Copy the DLL file to the application’s Bin folder.

Use the Wsdl.Exe Tool to Generate the Source Code File Issue the wsdl.exe command at the Visual Studio command prompt: Start/Programs/microsoft VS .Net/VS .Net Tools/ VS .Net Command prompt The following command example create a CustomerInfo.vb file for the testwebservice.asmx web service. wsdl.exe /l:vb http://dchaolaptop/aspnet/testwebservice.asmx?wsdl

Compile the Source Code File Into a DLL File The command below create a CustomerInfo.dll Vbc /t:library /r:system.dll,system.web.services.dll,system.xml.dll CustomerInfo.vb

<script runat="server"> sub CallService(s as object, e as eventArgs) dim myProxy as new CustomerInfo lblCname.text=myProxy.GetCname(txtCID.text) lblRating.text=myProxy.GetRating(txtCID.text) end sub </script> <html> </head> <body> <form runat="server"> Enter CID: <asp:textbox id="txtCID" runat="server" /> <asp:label id="lblCname" runat="server"/> <asp:label id="lblRating" runat="server"/> <asp:button text="GetService" onClick="CallService" runat="server" /> </form> </body> </html> Demo: testProxy.aspx