CS 3870/CS 5870 Web Service.

Slides:



Advertisements
Similar presentations
Siebel Web Services Siebel Web Services March, From
Advertisements

1 CS 3870/CS 5870: Lab4 Save with Invalid Price Keep Order After Updating.
Web Services Web Services are the basic fundamental building blocks of invoking features that can be accessed by an application program. The accessibility.
1 Web Services I: Returning Data in XML Format. 2 Service-Oriented Architecture (SOA) Old Model for Applications Executables running on individual computers.
6/11/2015Page 1 Web Services-based Distributed System B. Ramamurthy.
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.
9. Web Services. 2 Microsoft Objectives “Web Services are poised to change the future of software development...” WebServices.
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.
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.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
DR.JOHN ABRAHAM PROFESSOR UTPA ASP.NET. ACTIVE SERVER PAGES (ASP) Web application development environment Web applications use web browser to display.
WSDL: Web Services Definition Language CS 795/895.
© Minder Chen, ASP.NET 2.0: Introduction - 1 ASP.NET 2.0 Minder Chen, Ph.D. Framework Base Class Library ADO.NET: Data & XML.
Distributed Communication via ASP.Net Web Services and.Net Remoting By Richard King.
Microsoft ® ASP.NET Presented by Joseph J. Sarna Jr. JJS Systems, LLC.
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.
ASP.NET application. Roadmap ASP.NET file types Bin directory Application updates Simple application from start to finish using a virtual directory Behind.
Internet Technologies and Web Application Web Services With ASP.NET Tutorial: Introduction to.
1.NET Web Forms Web Services © 2002 by Jerry Post.
1 CS 3870/CS 5870: Note 11 Authentication and Authorization Membership Provider.
© Chinese University, CSE Dept. Distributed Systems / Simple Example Open Microsoft Visual Studio 2005:
1 CS 3870/CS 5870 Note04 Session Variables and Post Back.
1 CS 3870/CS 5870: Note 13 Lab 6 Authentication and Authorization Roles Management.
1 CS 3870/CS 5870: Note 07 Lab 3 Lab 4 Test 1: Two Tables.
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.
1 CS 3870/CS 5870: Note05 Prog3 Web Application with Database.
Visual Basic.NET Programming March 3, Agenda Questions / Discussion Cookies Project Work (Ends Around 9:00 PM) Demo's (15 minutes per team)
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.
1 CS387/CS587: Note 08 Shopping Bag DataTable. 2 DataClass Public Shared Function NewShoppingBag() As Data.DataTable Dim bag As New Data.DataTable bag.Columns.Add("Product.
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.
1 CS387/CS587: Note05 Lab 3. 2 Global.asax Must not be under any sub-folder Application_Start Application_End Application_Error Session_Start Session_End.
1 CS 3870/CS 5870: Note 12 Authentication and Authorization Membership Provider.
1 CS 3870/CS 5870: Note 16 Web User Controls. Prog 7 Copy Prog6 to Prog7 Modify all files for Prog7 Remove Web.config from sub-folders Make sure Prog7.
1 CS387/CS587: Note04 Lab 3. 2 Master Page All Web pages will be similar Should be created before other web pages Add New Items Controls on the Master.
1 CS 3870/CS 5870: Note 13 Web Service. 2 What is Web Service? Providing functionality online to other Web applications SOAP Simple Object Access Protocol.
1 CS 3870/CS 5870: Note 14. Prog5 Due 10 PM Wednesday, Oct 21 Authentication and Authorization 2.
1 CS 3870/CS 5870: Note07 Prog 4. Master Pages Creating a master page based on another master page MainMasterPage –For all Progs and Tests Prog4MasterPage.
1 CS 3870/CS 5870: Note 19 AJAX Prog8. Test 2 50 Points Thursday, Nov 12 2:00 PM – 4:00 PM Lab
Introduction to Web Services Srinath Vasireddy Support Professional Developer Support Microsoft Corporation.
1. Prog3 Try and Catch Testing 2 Catching Database Errors Protected Sub DetailsView1_ItemDeleted( sender As Object, e As DetailsViewDeletedEventArgs)
Jim Fawcett CSE681 – SW Modeling & Analysis Spring 2005
ASP.NET AJAX.
ASP.NET Forms.
Working with ASP.NET Master Pages.
Web Application with Database
CS 3870/CS 5870 Web User Controls.
28 Web Services.
Session Variables and Post Back
Web Programming Developing Web Applications including Servlets, and Web Services using NetBeans 6.5 with GlassFish.V3.
CS 3870/CS 5870 AJAX Prog8.
ASP.NET Web Forms and Web Services
How to Create a Simple Web Service and Use it in ASP.Net
PHP / MySQL Introduction
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.
CS 3870 Prog6 Roles Management Due Monday, November 5 Group Assignment.
Web Services Introduction
CS 3870/CS 5870 Web User Controls Events (II).
Application Infrastructure
Consuming Webservice in AX 2012
CS 3870 Prog5 Shopping Bag.
Introduction to Web Services
Distributed System using Web Services
Chapter 42 Web Services.
Button Web Server Controls
Presentation transcript:

CS 3870/CS 5870 Web Service

Web Service What is Web Service? Providing functionality online to other applications, Web and Windows applications. The original Goal of MS ASP.NET To enable developers to build and consume Web services with easy

Communication Between Disparate Systems Systems within an organization Unix Windows Mac Others Various systems need to talk with one another Not an easy job

SOAP and XML XML: eXtensible Makeup Language SOAP Simpler version of SGML (Standard Generalized Makeup Language) Best choice for disparate systems for now SOAP Simple Object Access Protocol

Previous Attempts DCOM Distributed Component Object Model RMI Remote Method Invocation CORBA: . . . IIOP: . . . Driven by a single vendor or Very vendor specific

Creating Web Service Add New Items Web Service Specify Name: UWPCSSEWebService2016 File UWPCSSEWebService2016.asmx File UWPCSSEWebService2016.vb under App_Code

WebService Page Directive File UWPCSSEWebService2016.asmx <%@ WebService Language="VB" CodeBehind="~/App_Code/ UWPCSSEWebService2016.vb" Class="WebService" %>

Web Service Class (VB File) Imports System.Web Imports System.Web.Services Imports System.Web.Services.Protocols ‘ To allow this Web Service to be called from script, ‘ using ASP.NET AJAX, uncomment the following line. ‘ <System.Web.Script.Services.ScriptService()> _ <WebService(Namespace:="http://tempuri.org/")> _ <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _ <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Public Class WebService Inherits System.Web.Services.WebService . . . End Class

Web Service Class ScriptService: AJAX Service.Protocols Web Service Namespace Default : http://tempuri.org/ Change to: https://alpha.ion.uwplatt.edu/YourWebSiteName/ ScriptService: AJAX Service.Protocols SOAP can be used in VB.NET

Web Service Class Public Class UWPCSSEWebService2016 Inherits System.Web.Services.WebService <WebMethod()> _ Public Function HelloWorld() As String Return "Hello, World" End Function Public Function WS_GetAllProducts() As Data.DataTable . . . ‘ Return a datatable End Class

Web Service Class Public Class UWPCSSEWebService2016 Inherits System.Web.Services.WebService <WebMethod()> _ Public Function WS_GetAllProducts() As Data.DataTable Public Sub WS_UpdateProduct(. . . Public Sub WS_InsertProduct(. . . Public Sub WS_DeleteProduct(. . . End Class Must have <WebMethod()> Can call methods of SQLDataClass Make sure method setupAdapter is called Prog3

Looking at Web Service https://alpha.ion.uwplatt.edu/CS3870/UWPCSSEWebService2016.asmx https://alpha.ion.uwplatt.edu/YangQ/UWPCSSEWebService2016.asmx

SOAP SOAP Envelop SOAP Body

Consuming Web Service Adding Web Reference Invoking Web Service from client application

Adding Web Reference Right click the root of the Web Site Add Service Reference Enter the URL of the wanted web service followed by “?WSDL” https://alpha.ion.uwplatt.edu/CS3870/UWPCSSEWebservice2016.asmx?WSDL Namespace Your choice for your program

Required Three Web References Service Reference to the Web Service created on Web site CS3870 Service Reference to the Web Service created on Web site YangQ Service Reference to the Web Service created on your Web site

The Web Config file will be updated automatically with the following. <system.serviceModel> <bindings> <basicHttpBinding> <binding name="UWPCSSEWebService2016Soap"> <security mode="Transport" /> </binding> <binding name="UWPCSSEWebService2016Soap1" /> </basicHttpBinding> </bindings> <client> <endpoint address="https://xray.ion.uwplatt.edu/cs3870/UWPCSSEWebservice2016.asmx" binding="basicHttpBinding" bindingConfiguration="UWPCSSEWebService2016Soap" contract="CS3870.UWPCSSEWebServiceSoap" name="UWPCSSEWebService2016Soap" /> </client> </system.serviceModel>

Selecting Web Services on Form Default.aspx Dim ws As String = DropDownList1.Text Dim obj As Object If ws = "CS3870" Then obj = New CS3870.UWPCSSEWebService2016SoapClient ElseIf ws = “YangQ" Then obj = New MyWebService.UWPCSSEWebService2016SoapClient Else obj = New YourWebService.UWPCSSEWebService2016SoapClient End If Session(“Prog9_WS") = obj

Display the selected Web Service name If ws = "CS3870" Then . . . obj = New YourWebService.UWPCSSEWebService2016SoapClient End If Session(“Prog9_WS") = obj ws = obj.ToString Dim c As Control = Master.Master.FindControl("form1") c = c.FindControl("ContentPlaceHolder1") c = c.FindControl("Label1") CType(c, Label).Text = ws Session("Prog9_WSName") = ws

Prog9MasterPage <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <h3>Prog 9: <asp:Label ID="Label1" runat="server" Text=""></asp:Label> </h3> </asp:Content> ws = obj.ToString Dim c As Control = Master.Master.FindControl("form1") c = c.FindControl("ContentPlaceHolder1") c = c.FindControl("Label1") CType(c, Label).Text = ws Session("Prog9_WSName") = ws

Invoking Web Methods on Form AllProducts.aspx Dim obj As Object Dim myTable As Data.DataTable Protected Sub Page_Load(. . .) Handles Me.Load obj = Session(“Prog9_WS") myTable = obj.WS_GetAllProducts() GridView1.DataSource = myTable GridView1.DataBind() End Sub

Invoking Web Methods on Form Product.aspx Protected Sub Page_Load(. . . ) Handles Me.Load If Session("Prog9_WS") Is Nothing Then Response.Redirect("~/Prog9/Default.aspx") End If obj = Session(“Prog9_WS") myTable = obj.WS_GetAllProducts() GridView1.DataSource = myTable GridView1.DataBind() End Sub

Try and Catch Protected Sub Button1_Click(. . .) Handles btnUpdate.Click Try . . . obj.WS_UpdateProduct(oldID, txtName.Text, txtPrice.Text, txtDescription.Text) Catch ex As Exception txtMsh.Text = ex.Message End Try End Sub

Shopping and Updating Look into Your Prog3

Accessing Database Using Web Service No Credit if Accessing Database without Web Service

Session Variables Need to be Created and Updated Name starting using “Prog9_”

Delete and Create Service Reference? Not Working Delete and Create Service Reference?

AJAX All Web Forms except Default.aspx Could have multiple UpdatePanels on one Web form.

Bonus Points