Distributed Computing, M. L. Liu

Slides:



Advertisements
Similar presentations
SOAP & Security IEEE Computer Society Utah Chapter Hilarie Orman - Purple Streak Development Tolga Acar - Novell, Inc. October 24, 2002.
Advertisements

SOAP : Simple Object Access Protocol
Web Services Web Services are the basic fundamental building blocks of invoking features that can be accessed by an application program. The accessibility.
Advanced Protocols 2004 Motivation Exchanging data over Networks –WebServices Network Services provided over http –”Wired Services” A New way to build.
XML in the real world (2) SOAP. What is SOAP? ► SOAP stands for Simple Object Access Protocol ► SOAP is a communication protocol ► SOAP is for communication.
Information Management NTU Web Services. Information Management NTU What Are Web Services? Semantically encapsulate discrete functionality Loosely coupled,
SE 370: Programming Web Services Week 4: SOAP & NetBeans Copyright © Steven W. Johnson February 1, 2013.
Web Services Nasrullah. Motivation about web service There are number of programms over the internet that need to communicate with other programms over.
Presentation 7 part 2: SOAP & WSDL. Ingeniørhøjskolen i Århus Slide 2 Outline Building blocks in Web Services SOA SOAP WSDL (UDDI)
XML Technologies and Applications Rajshekhar Sunderraman Department of Computer Science Georgia State University Atlanta, GA 30302
Grid Computing, B. Wilkinson, 20043a.1 WEB SERVICES Introduction.
Web Services & SOAP Protocol Sravan Kumar Ananthula.
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 Java Server Programming zLecture 1 focuses on: yIntroduction to web services y Web Services using Axis y The bigger Picture: Introduction to J2EE y Java.
Web Services CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
SSC2: Web Services. Web Services Web Services offer interoperability using the web Web Services provide information on the operations they can perform.
T Network Application Frameworks and XML Web Services and WSDL Sasu Tarkoma Based on slides by Pekka Nikander.
1 EIE424 Distributed Systems and Networking Programming –Part II 2. XML-RPC.
Evaluating Web Services for FDMS Cynthia Loitch OAR/PMEL (PI) Eugene Burger OAR/PMEL NOAA Research Webshop 2003 Longmont, CO 3-5 June 2003.
Web Services (SOAP, WSDL, and UDDI)
A Comparison of Java RMI, CORBA, and Web Services Technologies for Distributed SIP Applications Mark D. Hanes Stanley C. Ahalt Ashok K. Krishnamurthy Department.
1 HKU CSIS DB Seminar: HKU CSIS DB Seminar: Web Services Oriented Data Processing and Integration Speaker: Eric Lo.
Remote Procedure Calls Babak Esfandiari. RPC Introduced by Birrell & Nelson (1984) Remote Procedure Calls allow a program to make use of procedures executing.
Current Trends in Network- Based Application Developments Bill Chu Department of Software and Information Systems UNC Charlotte.
SOAP Web Services Tim Carver MRC HGMP-RC Hinxton Cambridge, UK.
1 EIE424 Distributed Systems and Networking Programming –Part II 3.1 SOAP – Introduction.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 23 — Simple Object Access Protocol (SOAP) and Microsoft BizTalk™ Outline 23.1Introduction 23.2Simple.
Enterprise Computing: Web Services
XML and Web Services (II/2546)
XML, XSL, and SOAP Building Object Systems from Documents CSC/ECE 591o Summer 2000.
S O A P ‘the protocol formerly known as Simple Object Access Protocol’ Team Pluto Bonnie, Brandon, George, Hojun.
.NET and SOAP An Overview of SOAP By Raghavendra Aekka.
A quick overview of Network communications A quick overview of Network communications Anthony Lomax Anthony Lomax Scientific Software Mouans-Sartoux, France.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
WSDL : Web Service Definition Language Dr. Yuhong Yan NRC-IIT-Fredericton Internet logic.
Web services In this presentation… –what is a web service? –web service benefits –web service standards –web service definitions –web service actions.
Agenda 1.WSDL & XML Schema Astronomicko-geofyzikálne observatórium, Modra An Order.
Netprog: Soap & XML-RPC1 XML-RPC and SOAP. Netprog: Soap & XML-RPC2 XML Extensible Markup Language Markup Language. –HTML is also a markup language (but.
Introduction to Web Services Presented by Sarath Chandra Dorbala.
Net-centric Computing Web Services. Lecture Outline  What is Web Service  Web Service Architecture  Creating and using Java Web Services  Apache Axis.
SOAP, Web Service, WSDL Week 14 Web site:
SOAP : Simple Object Access Protocol A ‘clean’ tool for remote procedure calls.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 9 Web Services: JAX-RPC,
CS520 Web Programming Introduction to Web Services
SOAP (Simple Object Access Protocol)
An Introduction to Web Services
Sabri Kızanlık Ural Emekçi
Chapter 5 Remote Procedure Call
WEB SERVICES.
T Network Application Frameworks and XML Web Services and WSDL Sasu Tarkoma Based on slides by Pekka Nikander.
SOAP : Simple Object Access Protocol
Web Services CO5027.
Web Services 9/18/2018.
XML-RPC a lightweight data communication protocol
Overview of Web Services
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.
The Simple Object Access Protocol
Chapter 9 Web Services: JAX-RPC, WSDL, XML Schema, and SOAP
WEB SERVICES Mr. P. VASANTH SENA.
Implementation of Web Services in Perl by Litis Abraham & Gomathy Sankara CS522 Fall 2001 Semester Project 11/28/2018 Web Services in Perl.
CIS Distributed and Parallel Architectures
Introduction to Web Services Protocols
SOAP : Simple Object Access Protocol
Creating a Distributed System with Remote Procedure Calls and Web Services Ch.5 B.Ramamurthy 2/17/2019 B.Ramamurthy.
CS5220 Advanced Topics in Web Programming Web Services
Deepak Shenoy Agni Software
WebServices Using JAX-RPC
WEB SERVICES Mahmoud Rabie – EGJUG 2006.
Chapter 42 Web Services.
Presentation transcript:

Distributed Computing, M. L. Liu Web Services M. L. Liu 11/7/2018 Distributed Computing, M. L. Liu

Sources of Information Programming Web Services with SOAP, by Snell et al, O’Reilly SOAP Tutorial, http://www.w3schools.com/soap/default.asp SoapRPC.com: Tutorials, (http://www.soaprpc.com/tutorials/) A Busy Developer’s Guide To Soap1.1 DaveNet : XML-RPC for Newbies, http://davenet.userland.com/1998/07/14/xmlRpcForNewbies SoapRPC.com: Other resources, http://www.soaprpc.com/resources/ 11/7/2018 Distributed Computing, M. L. Liu

Distributed Computing, M. L. Liu Web Services Network services provided over HTTP – “wired services” It is promoted as a new way to build network applications from distributed components that are language- and platform-independent The technologies are still evolving We are more interested in the concept and principles, but we will look into one API (Apache SOAP). 11/7/2018 Distributed Computing, M. L. Liu

Distributed Computing, M. L. Liu Web Services 11/7/2018 Distributed Computing, M. L. Liu

Web Service Software Components A web service is a message-based network service. A server which provides a web service must be capable of “sending and receiving messages using some combination of standard Internet protocols” 11/7/2018 Distributed Computing, M. L. Liu

Just-in-time integration Network services can be integrated dynamically, on an as-needed basis. SunMicro’s jini is a framework that supports the idea. Network services are registered with a service registry; a service consumer/client looks up the registry to fulfill its needs. The binding of a client to the service can occur at runtime. 11/7/2018 Distributed Computing, M. L. Liu

Web service protocol stack 11/7/2018 Distributed Computing, M. L. Liu

Distributed Computing, M. L. Liu Web service protocols 11/7/2018 Distributed Computing, M. L. Liu

Distributed Computing, M. L. Liu SOAP SOAP is a protocol which applies XML for message exchange in support of remote method calls over the Internet. Compared to remote method invocation or CORBA-based facilities: SOAP is web-based or “wired” and hence is not subject to firewall restrictions Language-independent Can provide just-in-time service integration 11/7/2018 Distributed Computing, M. L. Liu

Remote Procedure Call using HTTP 11/7/2018 Distributed Computing, M. L. Liu

Distributed Computing, M. L. Liu SOAP Messages 11/7/2018 Distributed Computing, M. L. Liu

An XML-encoded SOAP RPC 11/7/2018 Distributed Computing, M. L. Liu

Example of a SOAP message 11/7/2018 Distributed Computing, M. L. Liu

Distributed Computing, M. L. Liu A SOAP Message that contains a remote procedure call source: (http://www.soaprpc.com/tutorials/) A Busy Developer’s Guide To Soap1.1 <SOAP-ENV:Envelope SOAP-ENV:encodingStyle= "http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"> <SOAP-ENV:Body>        <m:getStateName xmlns:m="http://www.soapware.org/">          <statenum xsi:type="xsd:int">41</statenum>          </m:getStateName>  </SOAP-ENV:Body> </SOAP-ENV:Envelope> 11/7/2018 Distributed Computing, M. L. Liu

Distributed Computing, M. L. Liu An Example SOAP Request source: (http://www.soaprpc.com/tutorials/) A Busy Developer’s Guide To Soap1.1 11/7/2018 Distributed Computing, M. L. Liu

Distributed Computing, M. L. Liu Response example  source: (http://www.soaprpc.com/tutorials/) A Busy Developer’s Guide To Soap1.1 11/7/2018 Distributed Computing, M. L. Liu

Distributed Computing, M. L. Liu Example of a SOAP message for an error RPC response source: (http://www.soaprpc.com/tutorials/) A Busy Developer’s Guide To Soap1.1 11/7/2018 Distributed Computing, M. L. Liu

Distributed Computing, M. L. Liu HTTP and SOAP RPC Request source: (http://www.soaprpc.com/tutorials/) A Busy Developer’s Guide To Soap1.1 A SOAP message can be used to transport a SOAP remote procedure request/response, as follows: POST /examples HTTP/1.1 User-Agent: Radio UserLand/7.0 (WinNT) Host: localhost:81 Content-Type: text/xml; charset=utf-8 Content-length: 474 SOAPAction: "/examples" <blank line> <text for SOAP message> 11/7/2018 Distributed Computing, M. L. Liu

Distributed Computing, M. L. Liu An HTTP request that carries a SOAP RPC request source: (http://www.soaprpc.com/tutorials/) A Busy Developer’s Guide To Soap1.1 POST /examples HTTP/1.1 User-Agent: Radio UserLand/7.0 (WinNT) Host: localhost:81 Content-Type: text/xml; charset=utf-8 Content-length: 474 SOAPAction: "/examples" <?xml version="1.0"?> <SOAP-ENV:Envelope SOAP-ENV:encodingStyle= "http://schemas.xmlsoap.org/soap/encoding/" xmlns: SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns: SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"> <SOAP-ENV:Body>        <m:getStateName xmlns:m="http://www.soapware.org/">          <statenum xsi:type="xsd:int">41</statenum>          </m:getStateName>  </SOAP-ENV:Body>  </SOAP-ENV:Envelope> 11/7/2018 Distributed Computing, M. L. Liu

Distributed Computing, M. L. Liu An HTTP request that carries a SOAP RPC response source: (http://www.soaprpc.com/tutorials/) A Busy Developer’s Guide To Soap1.1 HTTP/1.1 200 OK Connection: close Content-Length: 499 Content-Type: text/xml; charset=utf-8 Date: Wed, 28 Mar 2001 05:05:04 GMT Server: UserLand Frontier/7.0-WinNT <?xml version="1.0"?> <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">    <SOAP-ENV:Body>       <m:getStateNameResponse xmlns:m="http://www.soapware.org/">          <Result xsi:type="xsd:string">South Dakota</Result>          </m:getStateNameResponse>       </SOAP-ENV:Body>    </SOAP-ENV:Envelope> 11/7/2018 Distributed Computing, M. L. Liu

Distributed Computing, M. L. Liu Error Example source: (http://www.soaprpc.com/tutorials/) A Busy Developer’s Guide To Soap1.1 HTTP/1.1 500 Server Error Connection: close Content-Length: 511 Content-Type: text/xml; charset=utf-8 Date: Wed, 28 Mar 2001 05:06:32 GMT Server: UserLand Frontier/7.0-WinNT <?xml version="1.0"?> <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">    <SOAP-ENV:Body>       <SOAP-ENV:Fault>          <faultcode>SOAP-ENV:Client</faultcode>          <faultstring>Can't call getStateName because there are too many parameters.</faultstring>          </SOAP-ENV:Fault>       </SOAP-ENV:Body>    </SOAP-ENV:Envelope> 11/7/2018 Distributed Computing, M. L. Liu

SOAP Packages source: http://www.soapuser.com Apache SOAP for Java Apache Axis for Java Idoox WASP for C++ Microsoft SOAP Toolkit (part of the .net framework) SOAP::Lite for Perl 11/7/2018 Distributed Computing, M. L. Liu

Distributed Computing, M. L. Liu Apache SOAP Allows clients and services to be written in Java Part of the Apache-XML project (http://xml.apache.org/) SOAP package downloadable: http://xml.apache.org/dist/soap/ Installation instruction: http://www.xmethods.com/gettingstarted/apache.html 11/7/2018 Distributed Computing, M. L. Liu

Apache SOAP installation 11/7/2018 Distributed Computing, M. L. Liu

Distributed Computing, M. L. Liu Classpath setting set CLASSPATH= C:\soap\soap-2_2\lib\xerces.jar; C:\jdk1.3\bin; C:\jdk1.3\lib\tools.jar; C:\soap\soap-2_2\lib\mail.jar; C:\soap\soap-2_2\lib\soap.jar; C:\soap\soap-2_2\lib\activation.jar; C:\tomcat\lib\servlet.jar; .; 11/7/2018 Distributed Computing, M. L. Liu

Distributed Computing, M. L. Liu Writing a Client Application using Apache SOAP source: http://www.xmethods.com/gettingstarted/apache.html Classpath Your CLASSPATH environment variable should have both the "soap.jar" and "xerces.jar" JAR files included. Importing packages For basic SOAP method invocation, you should import the following at minimum: // Required due to use of URL class , required by Call class import java.net.*; // Required due to use of Vector class import java.util.*; // Apache SOAP classes used by client import org.apache.soap.util.xml.*; import org.apache.soap.*; import org.apache.soap.rpc.*; 11/7/2018 Distributed Computing, M. L. Liu

Ready-made SOAP Services A number of SOAP ready-made services are available at http://www.xmethods.com/ XMethods Service Weather Temperature ID8 Service Owner:xmethods.net Contact Email:support@xmethods.net Service Description:Current temperature in a given U.S. zipcode region. SOAP Implementation:Apache SOAP 11/7/2018 Distributed Computing, M. L. Liu

Distributed Computing, M. L. Liu Sample SOAP service Found at http://www.xmethods.com 11/7/2018 Distributed Computing, M. L. Liu

RPC Profile for Service See sample: TempClient.java 11/7/2018 Distributed Computing, M. L. Liu

Client program samples See samples in client folder: TempClient.java StockQuoteClient.java CurrencyClient.java 11/7/2018 Distributed Computing, M. L. Liu

Distributed Computing, M. L. Liu SOAP data types SOAP Data Types, http://www.sdc.iup.edu/outreach/spring2002/webservices/datatypes.html Uses XML Schema data types Primitive Types string, boolean, decimal, float, double, duration, dateTime, time, date, gYearMonth, gYear, gMonthDay, gDay, gMonth, hexBinary, base64Binary, anyURI, QName, NOTATION 11/7/2018 Distributed Computing, M. L. Liu

Distributed Computing, M. L. Liu SOAP data types Derived Types Simple types (derived from a single primitive type) * integer is derived from decimal * int (-2147483648 <= int <= 2147483647) is derived from long which is derived from integer * 5-digit zip code can be derived from int * may use regular expressions to specify derived types, such as ([A-Z]){2,3}-\d{5} 11/7/2018 Distributed Computing, M. L. Liu

Distributed Computing, M. L. Liu Complex Type Complex types (struct or array) Struct example <instructor> <firstname xsi:type="xsd:string">Ed</firstname> <lastname xsi:type="xsd:string">Donley</lastname> </instructor> Array example <mathcourses xsi:type= "SOAP-ENC:Array" SOAP ENC:arrayType="se:string[3]"> <se:string>10452C</se:string> <se:string>10454C</se:string> <se:string>11123T</se:string> </mathcourses> 11/7/2018 Distributed Computing, M. L. Liu

Creating Web Services (server-side SOAP) O'Reilly Network: Using SOAP with Tomcat [Feb. 27, 2002] http://www.onjava.com/pub/a/onjava/2002/02/27/tomcat.htm Apache SOAP allows you to create and deploy a SOAP web service. You must install some .jar files on your system and set the CLASSPATH to them: Algorithm: Write a class for providing the service. Create a deployment descriptor in XML. Deploy the service with the service manager. 11/7/2018 Distributed Computing, M. L. Liu

The Apache SOAP service manager The service manager is itself implemented as a SOAP service. To see what services are deployed on your system: java org.apache.soap.server.ServiceManagerClient http://localhost:8080/soap/servlet/rpcrouter list To deploy a service: java org.apache.soap.server.ServiceManagerClient http://localhost:8080/soap/servlet/rpcrouter deploy foo.xml 11/7/2018 Distributed Computing, M. L. Liu

Distributed Computing, M. L. Liu Creating a SOAP Service O'Reilly Network: Using SOAP with Tomcat [Feb. 27, 2002] http://www.onjava.com/pub/a/onjava/2002/02/27/tomcat.html A SOAP service can be just about any Java class that exposes public methods for invocation. The class does not need to know anything about SOAP, or even that it is being executed as a SOAP service. The method parameters of a SOAP service must be serializable. The available types that can be used as SOAP service parameters are shown in (Listing 2) (shown on next slide) 11/7/2018 Distributed Computing, M. L. Liu

SOAP Service Parameter Types All Java primitive types and their corresponding wrapper classes Java arrays java.lang.String java.util.Date java.util.GregorianCalendar java.util.Vector java.util.Hashtable java.util.Map 11/7/2018 Distributed Computing, M. L. Liu

SOAP Service Parameter Types java.math.BigDecimal javax.mail.internet.MimeBodyPart java.io.InputStream javax.activation.DataSource javax.activation.DataHandler org.apache.soap.util.xml.QName org.apache.soap.rpc.Parameter java.lang.Object (must be a JavaBean) 11/7/2018 Distributed Computing, M. L. Liu

Sample SOAP Service Implementations See sample in SOAP folder: TempService: A temperature service Exchange: currency exchange service and client 11/7/2018 Distributed Computing, M. L. Liu

Sample SOAP Service Class // A sample SOAP service class // source: http://www.onjava.com/pub/a/onjava/2002/02/27/tomcat.html package onjava; public class CalcService { public int add(int p1, int p2) { return p1 + p2; } public int subtract(int p1, int p2) { return p1 - p2; 11/7/2018 Distributed Computing, M. L. Liu

Deployment Descriptor <isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment" id="urn:onjavaserver"> <isd:provider type="java" scope="Application" methods="add subtract"> <isd:java class="onjava.CalcService"/> </isd:provider> <isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListener> </isd:service> 11/7/2018 Distributed Computing, M. L. Liu

Distributed Computing, M. L. Liu Summary SOAP is a protocol that makes use of HTTP requests and responses to effect remote method calls to web services. A SOAP method call is encoded in XML and is embedded in an HTTP request The return value of a method call is likewise embedded and encoded in an HTTP response A number of SOAP APIs are available for programming web services and client method calls. The Apache API was introduced. 11/7/2018 Distributed Computing, M. L. Liu