21
Dodick Zulaimi Sudirman www.unimedia.ac.i d Lecture 14 Introduction to Web Service Pengantar Teknologi Internet Introduction to Internet Technology

Dodick Zulaimi Sudirman Lecture 14 Introduction to Web Service Pengantar Teknologi Internet Introduction to Internet Technology

Embed Size (px)

Citation preview

Page 1: Dodick Zulaimi Sudirman  Lecture 14 Introduction to Web Service Pengantar Teknologi Internet Introduction to Internet Technology

Dodick Zulaimi Sudirman

www.unimedia.ac.id

Lecture 14Introduction to Web Service

Pengantar Teknologi Internet

Introduction to Internet Technology

Page 2: Dodick Zulaimi Sudirman  Lecture 14 Introduction to Web Service Pengantar Teknologi Internet Introduction to Internet Technology

www.dodick-lecture.co.cc Dodick Zulaimi Sudirman

www.unimedia.ac.id

Web Services

• Web Services is a software component stored on one computer that can be accessed via method calls by an application or another computer network

• Web Services protocols and standards are the technology that promote the sharing and distribution of information and business data

Page 3: Dodick Zulaimi Sudirman  Lecture 14 Introduction to Web Service Pengantar Teknologi Internet Introduction to Internet Technology

www.dodick-lecture.co.cc Dodick Zulaimi Sudirman

www.unimedia.ac.id

Why Use Web Services

• Easy to create standards-compliant services• Does not favor any particular computer

language or operating system• Output can be transformed for a wide variety

of uses• It makes a lot of sense for libraries to exploit

the Web Service technique

Page 4: Dodick Zulaimi Sudirman  Lecture 14 Introduction to Web Service Pengantar Teknologi Internet Introduction to Internet Technology

www.dodick-lecture.co.cc Dodick Zulaimi Sudirman

www.unimedia.ac.id

When to use it

• Applications do not have severe restrictions on reliability and speed.

• Two or more organizations need to cooperate– One needs to write an application that uses

another’s service.• Services can be upgraded independently of

clients.– Google can improve PageRank implementation

without telling developer.– Just don’t change the WSDL.

• Services can be easily expressed with simple request/response semantics and simple state.– HTTP and Cookies, for example.

Page 5: Dodick Zulaimi Sudirman  Lecture 14 Introduction to Web Service Pengantar Teknologi Internet Introduction to Internet Technology

www.dodick-lecture.co.cc Dodick Zulaimi Sudirman

www.unimedia.ac.id

Web Services Usage

• Getting stock price information.• Obtaining weather reports.• Making flight reservations.

Page 6: Dodick Zulaimi Sudirman  Lecture 14 Introduction to Web Service Pengantar Teknologi Internet Introduction to Internet Technology

www.dodick-lecture.co.cc Dodick Zulaimi Sudirman

www.unimedia.ac.id

Servlets/CGI VS Web Services

Browser

WebServer

HTTP GET/POST

DB

JDBC

WebServer

DB

JDBC

Browser

WebServer

SOAP

GUIClient

SOAPWSDL

WSDL

WS

DL

WS

DL

Page 7: Dodick Zulaimi Sudirman  Lecture 14 Introduction to Web Service Pengantar Teknologi Internet Introduction to Internet Technology

www.dodick-lecture.co.cc Dodick Zulaimi Sudirman

www.unimedia.ac.id

Web Services Components Relationship

Service Broker

Service ProviderService Requester

Page 8: Dodick Zulaimi Sudirman  Lecture 14 Introduction to Web Service Pengantar Teknologi Internet Introduction to Internet Technology

www.dodick-lecture.co.cc Dodick Zulaimi Sudirman

www.unimedia.ac.id

Web Services Components Relationship

• A service broker, acts as a look up service between a service provider and a service requestor.

• A service provider, publishes its services to the service broker.

• A service requester, asks the service broker where to find a suitable service provider and that binds itself to the provider.

Page 9: Dodick Zulaimi Sudirman  Lecture 14 Introduction to Web Service Pengantar Teknologi Internet Introduction to Internet Technology

www.dodick-lecture.co.cc Dodick Zulaimi Sudirman

www.unimedia.ac.id

Web Services Invocation

gdp.globus.org

Page 10: Dodick Zulaimi Sudirman  Lecture 14 Introduction to Web Service Pengantar Teknologi Internet Introduction to Internet Technology

www.dodick-lecture.co.cc Dodick Zulaimi Sudirman

www.unimedia.ac.id

UDDI

• Universal Description, Discovery, and Integration

• A standard designed to provide a searchable directory of businesses and their Web Services.

• UDDI is designed like a phone book• UDDI business registration consists of three

components:– White Pages — address, contact, and known

identifiers;– Yellow Pages — industrial categorizations based on

standard taxonomies;– Green Pages — technical information about services

exposed by the business.

Page 11: Dodick Zulaimi Sudirman  Lecture 14 Introduction to Web Service Pengantar Teknologi Internet Introduction to Internet Technology

www.dodick-lecture.co.cc Dodick Zulaimi Sudirman

www.unimedia.ac.id

WSDL

• Web Service Description Language.– Describes how the service is to be used– Comparabe to Java Interface.– Guideline for constructing SOAP messages.– WSDL is a document written in XML which

describes a Web service. It specifies the location of the service and the operations (or methods) the service exposes

Page 12: Dodick Zulaimi Sudirman  Lecture 14 Introduction to Web Service Pengantar Teknologi Internet Introduction to Internet Technology

www.dodick-lecture.co.cc Dodick Zulaimi Sudirman

www.unimedia.ac.id

WSDL

>>>from SOAPpy import WSDL

>>>Server=WDSL.Proxy(‘path/to/WSDL’)

>>>server.method.keys()

[u’doGoogleSearch’,u’doGetCachedPage’ …]

>>>callInfo=server.methods[‘doGoogleSearch’]

>>>for arg in callInfo.inparams:

. . . print arg.name, arg.type

key (u’http://www.w3.org/2001/XMLSchema’,u’string’)

. . .

Define expected messages for a service, and their (input or output parameters).

An interface will group together a number of messages (operations)

The network location where the service is implemented , e.g. http://localhost:8080

Bind an Interface via a definition to a specific transport (e.g. HTTP) and messaging (e.g. SOAP) protocol

Page 13: Dodick Zulaimi Sudirman  Lecture 14 Introduction to Web Service Pengantar Teknologi Internet Introduction to Internet Technology

www.dodick-lecture.co.cc Dodick Zulaimi Sudirman

www.unimedia.ac.id

SOAP

• Simple Object Access Protocol– protocols used to perform the data transfer between

functions which is independent of any runtime environment.

– XML Message format between client and service– SOAP is not a transport protocol. You must attach your

message to a transport mechanism like HTTP

• A SOAP message is contained in an envelop.• The envelop element in turn contain (in

order)– An optional header with one or more child entries. – A body element that can contain one or more

child entries. These child entries may contain arbitrary XML data.

Page 14: Dodick Zulaimi Sudirman  Lecture 14 Introduction to Web Service Pengantar Teknologi Internet Introduction to Internet Technology

www.dodick-lecture.co.cc Dodick Zulaimi Sudirman

www.unimedia.ac.id

SOAP

• Headers are really just extension points where you can include elements from other namespaces.

• Body entries are really just placeholders for arbitrary XML from some other namespace.– The body contains the XML

message that you are transmitting.

Page 15: Dodick Zulaimi Sudirman  Lecture 14 Introduction to Web Service Pengantar Teknologi Internet Introduction to Internet Technology

www.dodick-lecture.co.cc Dodick Zulaimi Sudirman

www.unimedia.ac.id

SOAP

<?xml version="1.0"?><soap:Envelopexmlns:soap="http://www.w3.org/2001/12/soap-envelope"soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">

<soap:Header>...</soap:Header>

<soap:Body>...  <soap:Fault>  ...  </soap:Fault></soap:Body>

</soap:Envelope>

Page 16: Dodick Zulaimi Sudirman  Lecture 14 Introduction to Web Service Pengantar Teknologi Internet Introduction to Internet Technology

www.dodick-lecture.co.cc Dodick Zulaimi Sudirman

www.unimedia.ac.id

Web Service Architecture

Page 17: Dodick Zulaimi Sudirman  Lecture 14 Introduction to Web Service Pengantar Teknologi Internet Introduction to Internet Technology

www.dodick-lecture.co.cc Dodick Zulaimi Sudirman

www.unimedia.ac.id

Web Service Architecture

• Service Discovery:

Part of the architecture which allows us to find Web Services which meet certain requirements. This part is usually handled by UDDI .

• Service Description

Web Services is self-describing. This means that, once you've located a Web Service, you can ask it to 'describe itself' and tell you what operations it supports and how to invoke it. This is handled by the WSDL.

Page 18: Dodick Zulaimi Sudirman  Lecture 14 Introduction to Web Service Pengantar Teknologi Internet Introduction to Internet Technology

www.dodick-lecture.co.cc Dodick Zulaimi Sudirman

www.unimedia.ac.id

Web Service Architecture

• Service Invocation :

Invoking a Web Service involves passing messages between the client and the server. SOAP specifies how we should format requests to the server, and how the server should format its responses.

• Transport :

Finally, all these messages must be transmitted somehow between the server and the client. The protocol of choice for this part of the architecture is HTTP, in theory we could be able to use other protocols.

Page 19: Dodick Zulaimi Sudirman  Lecture 14 Introduction to Web Service Pengantar Teknologi Internet Introduction to Internet Technology

www.dodick-lecture.co.cc Dodick Zulaimi Sudirman

www.unimedia.ac.id

Summary

• Web Services– Web services can convert your applications into web-

applications.– By using XML,  messages can be sent between applications

• UDDI– uses WSDL to describe interfaces to web services

• WSDL– WSDL is an XML-based language for describing Web services

and how to access them.– WSDL describes a web service, along with the message

format and protocol details for the web service.

• SOAP– SOAP is a simple XML-based protocol that allows applications

to exchange information over HTTP.– Or more simply: SOAP is a protocol for accessing a web

service.

Page 20: Dodick Zulaimi Sudirman  Lecture 14 Introduction to Web Service Pengantar Teknologi Internet Introduction to Internet Technology

www.dodick-lecture.co.cc Dodick Zulaimi Sudirman

www.unimedia.ac.id

Reference

Gunzer, Hartwig. 2002.” Introduction to Web Services”. Borland

Garret. 2009. “A short introduction to Web Services”. http://gdp.globus.org/gt3-tutorial/multiplehtml/ch01s02.html akses akhir: 12/10/2010

Sebesta, Robert. 2009.”Programming the World Wide Web”. Pearson

http://onlamp.com/pub/a/onlamp/2007/11/01/the-mojo-of-dojo.html

Page 21: Dodick Zulaimi Sudirman  Lecture 14 Introduction to Web Service Pengantar Teknologi Internet Introduction to Internet Technology

Dodick Zulaimi Sudirman

www.unimedia.ac.id

Meet You at The Lab

THANK YOU