Presentation is loading. Please wait.

Presentation is loading. Please wait.

2b.1 Grid Computing Software Infrastructure Background information ITCS 4146/5146, UNC-Charlotte, B. Wilkinson, 2007 Feb 2, 2007 History, remote procedure.

Similar presentations


Presentation on theme: "2b.1 Grid Computing Software Infrastructure Background information ITCS 4146/5146, UNC-Charlotte, B. Wilkinson, 2007 Feb 2, 2007 History, remote procedure."— Presentation transcript:

1 2b.1 Grid Computing Software Infrastructure Background information ITCS 4146/5146, UNC-Charlotte, B. Wilkinson, 2007 Feb 2, 2007 History, remote procedure calls Service-Oriented Architecture Web services Implementation

2 2b.2 19952000200519901985 Distributed computing Remote Procedure calls (RPC) Concept of service registry Beginnings of service oriented architecture Object oriented approaches CORBA (Common Request Broker Architecture) Java Remote Method Invocation (RMI) Software Techniques: Web services Adopted for grid infrastructure components Mark-up languages, HTML XML Client-server model Sockets InternetWWW Networks

3 2b.3 Distributed Computing Concepts One of the underlying concepts is the client-server model. Client Server Request service Server response Example Database Network

4 2b.4 Remote Procedure Call Early “client-server” system introduced in 1980’s. Allows a local program to execute a procedure on a remote computer and get back results from the procedure. Basis of certain remote operations such as mounting remote files in a shared file system.

5 2b.5 Remote Procedure Call Fundamental issues We need to know how and where to make the call. Basic RPC requires calling program to know details about how to make the call (meaning and types augments and return value) Calling program also needs to know where to send request.

6 2b.6 Service Registry RPC introduced concept of a service registry, a third party used to identify location of “service” (procedure). Using a service registry is now part of what is now called a Service-Oriented Architecture.

7 2b.7 2. Find 3. Bind 1. Publish Service-Oriented Architecture Service requester Service registry Service provider

8 2b.8 Service-Oriented Architecture Steps: Services “published” in a Service registry. Service requestor asks Service Registry to locate service. Service requestor “binds” with service provider to invoke service.

9 2b.9 Later “RPC” systems (1990’s) Later forms of remote procedure calls in 1990’s introduced distributed objects: Examples CORBA (Common Request Broker Architecture) Java RMI (Remote Method Invocation)

10 2b.10 Some aspects for a better system Need: Universally agreed standardized interfaces Inter-operability Flexibility Internet standards (using Internet as network communication). Enter Web services and XML

11 2b.11 Web Services Introduced in the 2000. Software components designed to provide specific operations (“services”) accessible using standard Internet technologies and standardized protocols. The specific standards and protocols will be described shortly. For machine interaction over a network.

12 2b.12 Key aspects Has similarities with RMI and other distributed object technologies (CORBA etc.) but: Web Services are platform independent –They use XML –They use standardized packaging and Internet network protocols.

13 2b.13 Service Description Need a way of formally describing a service, what is does, how it is accessed, etc. Concept of an Interface Description Language (IDL) developed previously.

14 2b.14 XML-based Web Services XML provides a flexible basis for storing and retrieving service information on web services. In web services, the IDL is an XML language. Called Web Service Definition Language (WSDL)

15 2b.15 Web Service Definition Language (WSDL) A W3C standard XML document that describes three fundamental properties of a service: What it is - operations (methods) it provides. How it is accessed - data format, protocols. Where it is located - protocol specific network address. W3C -- The World Wide Web Consortium (W3C), www.w3c.org

16 2b.16 Simple Object Access Protocol (SOAP) Communication protocol for passing XML documents. W3C specification describes SOAP as: “SOAP is a lightweight protocol for exchange of information in a decentralized, distributed environment. It is an XML based protocol that consists of three parts: an envelope that defines a framework for describing what is in a message and how to process it, a set of encoding rules for expressing instances of application-defined datatypes, and a convention for representing remote procedure calls and responses.” SOAP originally abbreviation of Simple Object Access Protocol, but now simply SOAP.

17 2b.17 Simple Object Access Protocol (SOAP) Provides mechanisms for: –Defining communication unit - a SOAP message –Error handling –Extensions –Data representation –Remote Procedure Calls (RPC’s) –Document-centric approach for business transactions –Binding to HTTP

18 2b.18 Web Service Protocols Usually a HTTP transport protocol carries SOAP (Simple Object Access Protocol) messages holding XML documents. XML document SOAP message HTTP envelope

19 2b.19 SOAP Envelope <SOAP-ENV:Envelope xmlns=“http://schemas.xmlsoap.org/soap/ envelope/”>... namespace

20 2b.20 What goes down the Wire HTTP packet containing: –Stuff about context, transactions, routing, reliability, security –SOAP message –Attachments XML/SOAP standardization body, World Wide Web Consortium (W3C) covers SOAP and attachments.

21 2b.21 Service registries

22 2b.22 Universal Description Discovery, and Integration (UDDI) Registry Web service registries can be based upon UDDI registries introduced in 2001. UDDI specification standardized by OASIS (Organization for the Advancement of Structured Information Standards) See: http://www.oasis-open.org

23 2b.23 Notes UDDI registry is a web service itself. UDDI registry itself has to be known to both client(s) and service. Usually some form of service registration and locator needed. In grid computing, basic locator service is called an index service.

24 2b.24 Steps to access a web service in a Service-Oriented Architecture Client (Service requester) Server (Service provider) UDDI Service registry Publish Find WSDL Service definition UDDI Service definition Location of service Give me your WSDL WSDL Request service operation Result

25 2b.25 Question Could the WDSL document be provided by the registry, and if so, is that better? Answer

26 2b.26 Web Services “Stack” HTTP transport SOAP message carrying XML documents WSDL (Web Services Description Language used to describe message syntax for invoking a service and its response. UDDI (Universal Description, Discovery and Integration) used as web service discovery mechanism.

27 2b.27 Web Services Stack HTTP WSDL Service description UDDI Service discovery SOAP + XML Service invocation Service message transport ActivityProtocol/Language

28 2b.28 Web Service Implementation WSDL, containers, stubs, SOAP …

29 2b.29 Web Service Container Web Services generally “hosted” in a web service container – software environment that provides communication mechanisms to and from the web services and clients.

30 2b.30 Several possible software environments designed for web services: Apache Axis (Apache eXtensible Interaction System) IBM Websphere Microsoft.NET J2EE (Java 2 Enterprise Edition) server container Candidate for hosting web services especially in enterprise (business) applications.

31 2b.31 Apache Axis available for free down (Windows or Linux): http://ws.apache.org/axis Used for a web service assignment in Fall 2004/Fall 2005 grid course, see home page. Apache Axis requires an application server. –Can be installed on top of a servlet engine such as Apache Jakarta Tomcat. –However, could be installed on top of a fully- fleldged J2EE server.

32 2b.32 Web service environment Web service container Web services Client Will use an Application server (servlet engine) (e.g. Apache Jakara Tomcat ) (e.g. Apache Axis) Network SOAP messages carried with HTTP transport

33 2b.33 Client-Service Implementation In the implementation, it is convenient to use client and service stubs - java classes for interfacing to the web service SOAP messaging.

34 2b.34 Client Stub Between client code and the network is a client stub, sometimes called client proxy. Client stub responsible for taking request from client and converting request into a SOAP request on network - marshalling. Also responsible for receiving SOAP responses on network and converting to a suitable form for client.

35 2b.35 Server Stub Between service and network is a server stub, sometimes called a skeleton. Responsible for receiving SOAP request from client stub and converting it into a suitable form for the service - unmarshalling. Also converts response from service into a SOAP message for client stub.

36 2b.36 Web Service Application Call client stub SOAP request Request service Result returned SOAP response Client receives result

37 2b.37 Steps Client calls client stub. SOAP request sent across network Server stub receives request and sends request to service Service send result to serve stub Server stub sends result across network to client stub. Client stub sends result to client.

38 2b.38 Math Web service For concreteness, let us consider web service used in Fall 2004/2005 assignment 1. A simple version is: public class MyMath { public int squared(int x) { return x * x; }

39 2b.39 Question What does this service do? Answer

40 2b.40 Web Service Description Recall use an Interface Description language (IDL) called WSDL to formally describe a service, what is does, how it is accessed, etc.

41 2b.41 Parts of a WSDL Document Root definitions - namespaces portType definitions - abstract definition of service Message definitions - parameters in method signature Type definitions - data types Binding definitions - to protocols i.e. SOAP over HTTP Service definitions - where service is, ports

42 2b.42 <wsdl:definitions targetNamespace="http://DefaultNamespace" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://DefaultNamespace" xmlns:intf="http://DefaultNamespace" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/ encoding/" namespace="http://DefaultNamespace" use="encoded"/> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/ encoding/" namespace="http://DefaultNamespace" use="encoded"/> Namespaces Message definitions portType Bindings Service definitions WSDL file for math web service

43 2b.43 Root Definitions Namespaces <wsdl:definitions targetNamespace="http://DefaultNamespace" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://DefaultNamespace" xmlns:intf="http://DefaultNamespace" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

44 2b.44 portType Describes “What” - an abstract definition of service operation. Uses the elements: message definitions - a set of parameters referred to by method signature, decomposed into parts type definitions - defines all data types used

45 2b.45 <wsdl:input message="impl:squaredRequest“ name="squaredRequest"/> <wsdl:output message="impl:squaredResponse“ name="squaredResponse"/> portType Definitions

46 2b.46 Message Definitions Standard XML integer type – no special types in this example

47 2b.47 Binding Describes “how” the elements in abstract interface (portType) are converted in actual data representations and protocols e.g. SOAP over HTTP.

48 2b.48 <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/ soap/http"/> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/ encoding/" namespace="http://DefaultNamespace" use="encoded"/> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/ encoding/" namespace="http://DefaultNamespace" use="encoded"/> Binding definitions

49 2b.49 port and service Describe “where” service is. port - describes how a binding is deployed at the endpoint of a network service - a named collection of ports

50 2b.50 <wsdl:port binding="impl:MyMathSoapBinding“ name="MyMath"> <wsdlsoap:address location="http://localhost:8080/axis/myaccount/MyMath"/> Port/Service Definitions Where math service is

51 2b.51 Build and deploy a web service Several ways to create web service within a container and have accessible by clients. Fundamental service components to build: Web service code WDSL service description file Web service stub and client components: Client stub Client code

52 2b.52 What to create to deploy and test a service ClientClient stub Server stub Service ContainerClient Applications WSDL service description Web service code WDSL service description file Web service stub Client stub Client code

53 2b.53 In the following, will assume that we are using Apache Axis, which has several tools for building and deploying a web service.

54 2b.54 Java Web Service (JWS) deployment facility Absolute simplest way in Axis to deplore a web service: First, web service class file with methods created. Then file simply renamed as.jws and dropped into a specific directory that axis expects.jws services to be. Service code with.jws extension interpreted as a web service..jws file automatically compiled if necessary when service called. All public methods in service code available and accessible as service operations. Simple but has restrictions/limitations.

55 2b.55 jws facility Could actually use web service after deployment with JWS without using a WSDL file nor stubs. One could just use service URL, which would have a.jws extension. Client and service need code to make SOAP calls. However, one would normally create a WSDL file and stubs, and get stubs to handle SOAP.

56 2b.56 Creating WSDL file Several ways this can be approached: Create service code first and use as basis for WSDL file or Create WSDL file first and use this as basis for the service code Second method probably better from a Software Engineering perspective, but will look at both.

57 2b.57 WSDL from Service Code Java2WSDL Tool Axis Java2WSDL program generates WSDL file (and its schema) from service code. Program has number of flags including to specify: Name of the output WSDL file (-o flag) Location (URL) of the service (-l flag) Namespace of WSDL file (-n flag) Mapping from package to namespace (-p flag)

58 2b.58 <wsdl:definitions targetNamespace="http://DefaultNamespace" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://DefaultNamespace" xmlns:intf="http://DefaultNamespace" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <!--WSDL created by Apache Axis version: 1.2 Built on May 03, 2005 (02:20:24 EDT)--> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/ encoding/" namespace="http://DefaultNamespace" use="encoded"/> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/ encoding/" namespace="http://DefaultNamespace" use="encoded"/> WSDL file created

59 2b.59 Stubs from WSDL If we have WSDL document for service, can use tools to generate client and server stubs. –Axis WSDL2Java program generates stubs for use on client and server.

60 2b.60 Web Service Deployment Descriptor (WSDD) WSDD is an XML language used to describe how to deploy a service. Provides for greater flexibility than with jws “instant” deployment facility.

61 2b.61 WSDD file for MyService <deployment xmlns="http://xml.apache.org/axis/wsdd/ xmlns:java= "http://xml.apache.org/axis/wsdd/providers/java">

62 2b.62 Deployment with WSDD file Once WSDD file say called service.wsdd created, can deploy service with Axis tool, AdminClient: java org.apache.axis.client.AdminClient service.wsdd (WSDD was not used in assignment 1 in Fall 2004/5)

63 2b.63 Client side programming Once deployed service, want to use it or allow others to use it. Depending upon details of deployed service and web service environment, a simple Java program can be used to access service such as: import localhost.axis.yourusername.MyMath_jws.MyMathServiceLocator; import localhost.axis.yourusername.MyMath_jws.MyMathService; import localhost.axis.yourusername.MyMath_jws.MyMath; public class MyMathClient { public static void main(String args[]) throws Exception { MyMathService service = new MyMathServiceLocator(); MyMath myMath = service.getMyMath(); int x = (new Integer(args[0])).intValue(); System.out.println("The square of " + args[0] + " is " + myMath.squared(x)); }

64 2b.64 More information Assignment 1 in Fall 2004/Fall 2005 grid computing required one to write and deploy a web service into tomcat container using axis tools, and test it with a simple client, see: http://www.cs.uncc.edu/~abw/ITCS4010F05/assign1.doc This assignment dropped from Spring 2007 to allow us to other new true grid computing assignments.

65 2b.65 Quiz (Multiple Choice)

66 2b.66 What is a WSDL document? (a) One that describes how to access a service and use it (b) One that describes the data of a service (c) One that describes how to use the client code (d) None of the other answers

67 2b.67 What is SOAP? (a) Something you use to clean yourself (b) A protocol for passing XML documents (c) A protocol for passing object-oriented programs (d) None of the other answers

68 2b.68 What can UDDI be used for? (a) To transmit data between computers (b) As a universal data description interface (c) As a web services registry (d) To encode the characters of the world

69 2b.69 What is Apache Axis? (a) A tool used by American Indians (b) A hosting environment for web services (c) A compiler (d) A type of make tool

70 2b.70 Which of the following contains all the services that have been deployed? (a) Class (b) Shell (c) Container (d) Object

71 2b.71 What is a client stub? (a) A way of offending a customer (b) Code between the client code and the network (c) A document that explains the client code (d) None of the other answers

72 2b.72 More information on Axis http://xml.apache.org/axis

73 2b.73 Questions


Download ppt "2b.1 Grid Computing Software Infrastructure Background information ITCS 4146/5146, UNC-Charlotte, B. Wilkinson, 2007 Feb 2, 2007 History, remote procedure."

Similar presentations


Ads by Google