Web Services in.net (1)



Similar documents
Ambientes de Desenvolvimento Avançados

Web services can convert your existing applications into web applications.

Web Services with ASP.NET. Asst. Prof. Dr. Kanda Saikaew Department of Computer Engineering Khon Kaen University

Outline SOA. Properties of SOA. Service 2/19/2016. Definitions. Comparison of component technologies. Definitions Component technologies

Building Web Services with Apache Axis2

Web Service Development Using CXF. - Praveen Kumar Jayaram

Q Lately I've been hearing a lot about WS-Security. What is it, and how is it different from other security standards?

Module 13 Implementing Java EE Web Services with JAX-WS

ITS. Java WebService. ITS Data-Solutions Pvt Ltd BENEFITS OF ATTENDANCE:

Java Web Services Training

Creating and Consuming XML Web Services

T Network Application Frameworks and XML Web Services and WSDL Tancred Lindholm

Web Services API Developer Guide

Developing Java Web Services

WEB SERVICES. Revised 9/29/2015

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Motivation Definitions EAI Architectures Elements Integration Technologies. Part I. EAI: Foundations, Concepts, and Architectures

JVA-561. Developing SOAP Web Services in Java

Author: Gennaro Frazzingaro Universidad Rey Juan Carlos campus de Mostòles (Madrid) GIA Grupo de Inteligencia Artificial

EAI OVERVIEW OF ENTERPRISE APPLICATION INTEGRATION CONCEPTS AND ARCHITECTURES. Enterprise Application Integration. Peter R. Egli INDIGOO.

A Web Services Created Online Training and Assessment Scheme

Creating Form Rendering ASP.NET Applications

The presentation explains how to create and access the web services using the user interface. WebServices.ppt. Page 1 of 14

CHAPTER 10: WEB SERVICES

Creating Web Services in NetBeans

Web Services. Distributed Object Systems 11. Web Services, SOAP and NET. Web Applications. Web Services. Web services vs Distributed Objects

Service Oriented Computing: SOAP, WSDL and UDDI. Dr. Cristian Mateos Diaz ( ISISTAN - CONICET

Grid Computing. Web Services. Explanation (2) Explanation. Grid Computing Fall 2006 Paul A. Farrell 9/12/2006


Virtual Credit Card Processing System

Creating Web Services Applications with IntelliJ IDEA

VALLIAMMAI ENGINEERING COLLEGE SRM NAGAR, KATTANKULATHUR DEPARTMENT OF COMPUTER APPLICATIONS SUBJECT : MC7502 SERVICE ORIENTED ARCHITECTURE

REST web services. Representational State Transfer Author: Nemanja Kojic

David Pilling Director of Applications and Development

Consuming a Web Service(SOAP and RESTful) in Java. Cheat Sheet For Consuming Services in Java

Using Web Services to exchange information via XML

Using ilove SharePoint Web Services Workflow Action

The Java Series. Java Essentials I What is Java? Basic Language Constructs. Java Essentials I. What is Java?. Basic Language Constructs Slide 1

Accessing Data with ADOBE FLEX 4.6

Middleware and the Internet. Example: Shopping Service. What could be possible? Service Oriented Architecture

JAVA API FOR XML WEB SERVICES (JAX-WS)

How to consume a Domino Web Services from Visual Studio under Security

4. Concepts and Technologies for B2C, B2E, and B2B Transaction

Introduction to Oracle WebLogic. Presented by: Fatna Belqasmi, PhD, Researcher at Ericsson

Oracle SOA Reference Architecture

Digital Signature Web Service Interface

Service Oriented Architectures

Lesson 4 Web Service Interface Definition (Part I)

Web Services ( )

Web Services Integration Case Study - Housing

AquaLogic Service Bus

Unit IV: SOAP protocol, XML-RPC, HTTP, SOAP faults and SOAP attachments, Web services, UDDI, XML security

Web Service Testing. SOAP-based Web Services. Software Quality Assurance Telerik Software Academy

Web Services. with Examples. Telemark University College Department of Electrical Engineering, Information Technology and Cybernetics

Whats the difference between WCF and Web Services?

WA2087 Programming Java SOAP and REST Web Services - WebSphere 8.0 / RAD 8.0. Student Labs. Web Age Solutions Inc.

T320 E-business technologies: foundations and practice

Web Services Technologies

HTTP and HTTPS Statistics Services

Hello World RESTful web service tutorial

Consuming and Producing Web Services with Web Tools. Christopher M. Judd. President/Consultant Judd Solutions, LLC

Service Oriented Architecture

Run-time Service Oriented Architecture (SOA) V 0.1

WEB SERVICES TEST AUTOMATION

Building and Using Web Services With JDeveloper 11g

Mobility Information Series

Cloud Computing & Service Oriented Architecture An Overview

REST vs. SOAP: Making the Right Architectural Decision

An Oracle White Paper November Oracle Primavera P6 EPPM Integrations with Web Services and Events

JAVA API FOR XML WEB SERVICES INTRODUCTION TO JAX-WS, THE JAVA API FOR XML BASED WEB SERVICES (SOAP, WSDL)

Developing Java Web Services to Expose the WorkTrak RMI Server to the Web and XML-Based Clients

Implementing SQI via SOAP Web-Services

4.2 Understand Microsoft ASP.NET Web Application Development

Middleware and the Internet

The Study on Mobile Phone-oriented Application Integration Technology of Web Services 1

SOA Fundamentals For Java Developers. Alexander Ulanov, System Architect Odessa, 30 September 2008

Web Applications Testing

LinuxWorld Conference & Expo Server Farms and XML Web Services

QuickBooks Web Connector Programmer s Guide

B2B Glossary of Terms

Oracle WebLogic Server

Learning Outcomes. Networking. Sockets. TCP/IP Networks. Hostnames and DNS TCP/IP

Features of The Grinder 3

10CS73:Web Programming

Introduction to Object-Oriented Programming

e-gov Architecture Service Interface Guidelines

How To Create A C++ Web Service

CST6445: Web Services Development with Java and XML Lesson 1 Introduction To Web Services Skilltop Technology Limited. All rights reserved.

Secure Authentication and Session. State Management for Web Services

Introduction to Visual Studio and C#

A standards-based approach to application integration

Ontology-based Web Service Composition: Part 1. Rolland Brunec Betreuerin: Sabine Maßmann Universität Leipzig, Abteilung Datenbanken

Transcription:

Web Services in.net (1) These slides are meant to be for teaching purposes only and only for the students that are registered in CSE4413 and should not be published as a book or in any form of commercial product, unless written permission is obtained. 1

What is a Web Service? A Web Service (WS) is a class (or many classes) that resides in a computer and it is accessible from another computer, in the sense that clients can call methods of this class remotely. In.NET, any method of a class can be equipped to be accessed remotely. All it needs is to associate the attribute [WebMethod] with that method. [ WebMethod ] public void MyMethod( ) { } 2

Web Services vs Local Services Web service Local service Class produces DLL file which is stored in local computer, and it is accessed from classes residing in some other computer Access is done via remote system calls managed by HTTP and SOAP (Simple Object Access Protocol) a protocol that allows calling remote methods). SOAP is written in XML. Class produces DLL file which is stored in local computer, and it is accessed from classes residing in same computer. Access is done via local system calls (managed by the local operating system). System calls are written in some language (part of the OS). 3

Web Services vs Local Services / Web service Documentation for a web method is provided via WSDL (Web Service Description Language). Local service Documentation for a local method is provided via a local API (Application Programming Interface). WSDL is written in XML. API may be written in XML. We learn about Web Services via UDDI (Universal Description Discovery and Integration) and DISCO. [ in practice, however, so far, we learn mostly through word-of-mouth ] We learn about local methods via the API. 4

Evolution of the internet and the WWW (0) HTML Generation 0 FTP, e-mail 5

Evolution of the web (1) HTML Generation 1 Static HTML 6

Evolution of the web (2) HTML Generation 2 Web Applications 7

Evolution of the web (3) HTML, XML HTML, XML Generation 3 (under construction) Web Services 8

Evolution of the web (4) HTML, XML empid HTML, XML, RDF Generation 4 (under contemplation) Semantic Web Emp-id Check and be able to realize that empid and Emp-id mean the same thing. 9

Benefits of Web Services May facilitate significant boost for developing distributed applications. Use standard (SOAP) for message exchange. Use standard for interface description (WSDL), in XML. Independent of programming languages and operating systems. Utilize existing Internet protocols (HTTP usually, but also SMTP and FTP). 10

Benefits of Web Services / Web Services allow you to interconnect: Different companies Many/any devices Applications Different clients Not just browsers Distribution and integration of application logic Enable the programmable Web Not just the purely interactive Web Loosely coupled (scale well) 11

Comparison of various distributed (Web Services and ancestors) technologies Java RMI.NET Remoting CORBA Web services Programming language Java.NET languages (C#, VB.NET,..) independent independent Interface definition Java Interfaces.NET Interfaces CORBA IDL WSDL (XMLbased) Data exchange format Java objects (binary).net objects IDL-specified objects XML data Transport protocol RMI-IIOP binary or OAP GIOP/IIOP HTTP, HTTPS, SMTP, FTP Message exchange format Java object serialization.net object serialization ORB/CDR SOAP 12

Web services related.net namespaces System.Web.Services for developing Web services (e.g.: WebService, WebMethod) System.Web.Services.Configuration for extending SOAP System.Web.Services.Description for creating and manipulating WSDL descriptions System.Web.Services.Discovery for using DISCO System.Web.Services.Protocols for implementation of communication protocols (e.g. SOAP- HTTP) System.Xml.Serialization for XML serialization 13

Example 14

A.NET web service has a.asmx file associated with it. This is the equivalent of the.aspx file of ASP.net applications. 15

Running The URL of the web service The WSDL (web service description language) The operation (method) exposed by this web service 16

The name of the Web Service. The result of invoking method Hello World 17

The code: Service1.asmx.cs using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Web; using System.Web.Services; namespace WebService1 { /// <summary> /// Summary description for Service1. /// </summary> public class Service1 : System.Web.Services.WebService { public Service1() { //CODEGEN: This call is required by the ASP.NET Web Services Designer InitializeComponent(); } #region Component Designer generated code //Required by the Web Services Designer private IContainer components = null; Class Service1 is our Web Service. (Subclass of class WebService) 18

/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { } /// <summary> /// Clean up any resources being used. /// </summary> protected override void Dispose( bool disposing ) { if(disposing && components!= null) { components.dispose(); } base.dispose(disposing); } C# attribute, that makes this method exposed as part of a web service. / #endregion // WEB SERVICE EXAMPLE // The HelloWorld() example service returns the string Hello World } } [WebMethod] public string HelloWorld() { return "Hello World"; } The web service method HelloWord() 19

How to use the HelloWorld web service Any.NET application Console application Windows application Web Application can use a Web Service. 20

A console application that uses the HelloWorld Web Service Output string Hello World comes from the returned value of method HelloWorld() that had been invoked. 21

The code 1. Create a console application, and 2. add access to the existing web service 22

3. Find the Web Service to use. In this case, select from the local machine. 23

4. Once the service is found, type the name you like to use to reference it (HelloWorldWebService, in this example). 24

5. The web service is made available for use in ConsoleApplication1. 25

The method HelloWorld() of this web service. Class1 is the console application that uses (consumes) the web service. The constructor of the web service points to the location of the.asmx file, so that the web service is found when needs to be used. 26

The consumer class: Class1 Instance variable of type HelloWorldWebService.Service1 27

Class1 is the consumer, i.e., contains the code that uses the web service. using System; Declare a WebService namespace ConsoleApplication1 { class Class1 { private HelloWorldWebService.Service1 myws; } } [STAThread] static void Main(string[] args) { new Class1().go(); } public void go() { myws = new HelloWorldWebService.Service1(); Console.WriteLine( myws.helloworld() ); } Call web service s method HelloWorld() Create web service object. 28