Академический Документы
Профессиональный Документы
Культура Документы
Distributed architecture
Waiting for Waiting for requests requests
(known location, (known location, known port) known port)
cgi-bin scripts:
Data transmitted as name-value pairs (HTML forms) Transport over (state-less) HTTP protocol no standards for keeping user sessions (statefullness)
SOAP-based communication
Waiting for Waiting for requests requests
(known location, (known location, known port) known port)
SOAP:
Data in a well-defined XML format Transport over various protocols
HTTP, SMTP are the most used, perhaps because they are firewall-friendly
Web services
A collection of XML-based technologies developed by the e-business community to address issues of:
service discovery interoperable data exchange and/or application invocation service compositions (workflow, business processes) Apache, IBM, HP, SUN & Microsoft (.NET)
http://www.webservices.org/
"A Web service is a software application identified by a URI, whose interfaces and bindings are capable of being defined, described and discovered as XML artefacts. A Web service supports direct interactions with other software agents using XML based messages exchanged via internet-based protocols."
http://www.w3c.org/TR/2002/WD-wsa-reqs-20020819
SOAP
http://www.w3c.org/TR/SOAP/
A lightweight protocol for exchange of information in a decentralised, distributed environment Two different styles to use:
to encapsulate RPC calls using the extensibility and flexibility of XML or to deliver a whole document without any method calls encapsulated
WSDL
http://www.w3.org/TR/wsdl/
what the service does (description) how to use it (method signatures) where to find the service
It does not depend on the underlying protocol But: It is not much human-readable
Hello.wsdl
<?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions targetNamespace="http://localhost:8080/axis/services/Hello" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:SOAPENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:impl="http://localhost:8080/axis/services/Hello-impl" xmlns:intf="http://localhost:8080/axis/services/Hello" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <wsdl:message name="setHelloMessageRequest"> <wsdl:part name="in0" type="xsd:string"/> </wsdl:message> <wsdl:message name="getHelloMessageResponse"> <wsdl:part name="return" type="xsd:string"/> </wsdl:message> <wsdl:message name="setHelloMessageResponse"> </wsdl:message> <wsdl:message name="getHelloMessageRequest"> </wsdl:message> <wsdl:portType name="HelloWorldService"> <wsdl:operation name="getHelloMessage"> <wsdl:input message="intf:getHelloMessageRequest"/> <wsdl:output message="intf:getHelloMessageResponse"/> </wsdl:operation> <wsdl:operation name="setHelloMessage" parameterOrder="in0"> <wsdl:input message="intf:setHelloMessageRequest"/> <wsdl:output message="intf:setHelloMessageResponse"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="HelloSoapBinding" type="intf:HelloWorldService"> <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="getHelloMessage"> <wsdlsoap:operation soapAction=""/> <wsdl:input> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="getHelloMessage" use="encoded"/> </wsdl:input> <wsdl:output> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/axis/services/Hello" use="encoded"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="setHelloMessage"> <wsdlsoap:operation soapAction=""/> <wsdl:input> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="setHelloMessage" use="encoded"/> </wsdl:input> <wsdl:output> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/axis/services/Hello" use="encoded"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="HelloWorldServiceService"> <wsdl:port binding="intf:HelloSoapBinding" name="Hello"> <wsdlsoap:address location="http://localhost:8080/axis/services/Hello"/> </wsdl:port> </wsdl:service> </wsdl:definitions>
The UDDI may be less used than predicted, especially on the Internet level BioMoby - an alternative for Life Sciences domain?
BioMoby
http://biomoby.org
How Java objects are converted to/from XML data (in order to be able to be put into SOAP messages) Important especially for the non-basic data types Its easier if your non-basic data types are Java Beans (having set/get methods for members)
Outline
Question: What is a Web Service? Answer: Acronym Soup!
Fundamentals (XML+)
UNIDATA
LDM
Problems
Simple Object Access Protocol (SOAP) is a lightweight protocol designed for the exchange of information
Solutions
SERVICES
Encoding rules
Answers.Com: Web-based applications that dynamically interact with other Web applications using open standards that include XML, UDDI and SOAP. (Yuck: UDDI?)
emergingtech.ittoolbox.com:
A Service-Oriented Architecture (SOA) is a collection of services or software agents that communicate freely with each other. Sub-topic definition: Web Services protocols and standards are the technology that promote the sharing and distribution of information and business data. A protocol is a standard method for transmitting data through a network. There are many different specialized protocols to accommodate the many kinds of data that might be transmitted.
SOAP
Simple Object Access Protocol
Horrible looking XML specification, but lots of SOAP pacakges available which are (generally easy to use), eg:
from SOAPpy import SOAPproxy url=http://services.xmethods.net:80/soap/servl et/rpcrouter n=urn:xmethods-Temperature server=SOAPProxy(url,namespace=n) temperature=server.getTemp(27502) Returns the temperature at U.S. zipcode 27502 (from Dive Into Python, Mark Pilgrim) (One knew a priori that a method named getTEmp would return a float given an argument of a zip code,
WSDL
>>>from SOAPpy import WSDL >>>Server=WDSL.Proxy(path/to/WSDL) >>>server.method.keys() [udoGoogleSearch,udoGetCachedPage ] >>>callInfo=server.methods[doGoogleSearch] >>>for arg in callInfo.inparams: . . . print arg.name, arg.type
key (uhttp://www.w3.org/2001/XMLSchema,ustring) . . .
Define expected messages for a service, and their (input or output parameters).
AC R
PR T
S IE RT PE O
REST (representational state transfer) is an approach for getting information content from a Web site by reading a designated (ok, you need a URI) Web page that contains an XML (Extensible Markup Language) file that describes and includes the desired content. Thats it! You use HTTP (get,put,) to a URI, with XML as the payload
SOAP::Lite
supports SOAP 1.1 specification all methods can be used for both setting and retrieving values:
if you provide no parameters, you will get current value, and if parameters are provided, a new value will be assigned to the object and the method in question will return the current object (if not stated otherwise) which is is suitable for stacking these calls like:
$lite = SOAP::Lite -> uri(openBQS') -> proxy('http://industry.ebi.ac.uk/soap/openBQS') ;
WS are easier to deploy because of their firewallfriendliness WS are quite well marketed (both from IT companies and Open Source projects) However:
user sessions are less standardised many parts yet-to-be-done (notification, transactions, security, etc.)
1. What is similar
The programming effort and maintainability is roughly the same both for Web Services and CORBA
but do you know anybody doing WS without a SOAP toolkit? not always (ask Perl folks) for WS you use frequently stubs generated from WSDL
WS are easier to deploy because of their firewallfriendliness WS are quite well marketed (both from IT companies and Open Source projects) Integration of WS into workflows seems to be very dynamic and very real topic
Problems
Any of the standard Internet protocols may be used to invoke web services over the network.
WEB
Solutions
The initial definition focuses specifically on HTTP/1.1 and the encrypted HTTPS Probs. with
Curr. sols.
SERVICES
It's an architectural style of building software applications that promotes Service The world loose coupling between components so that you can reuse them Problems Oriented before Arch.
WEB
SERVICES
Motiv. for Web Services +ve and -ve of Web Services
Solutions
Problems
WEB
SERVICES
Service Implementation
Types
Solutions
Message Operation Port Type
Motiv. for Binding Web Services +ve and -ve of Web Services Web Service Interface (WSDL)
Mahmoud Rabie Mahmoud - EGJUG 2006
Solution
Service
Problems
Web services provide interoperability between various software applications running on disparate platforms/operating systems Web services use open standards and protocols SERVICES By utilizing HTTP, web services can work through common firewall security measures without requiring Motiv. for changes to the firewall filtering rules. Other forms of RPC Web Services may more often+ve blocked of be and -ve
Web Services
Probs. with many sols. Curr.
WEB
Solutions
Web services allow software and services from different companies and locations to be combined easily to provide an integrated service. Web services allow theSERVICES reuse of services and components within an infrastructure. Web services are loosely coupled thereby facilitating a Motiv. for distributed approach to application integration. Web Services
+ve and -ve of Web Services
Problems
WEB
Solutions
Problems
WEB
SERVICES
Motiv. for Web Services +ve and -ve of Web Services
Solutions
History
Structured programming Object-oriented programming Distributed computing Electronic data interchange World Wide Web Web services
Hewlett-Packard's e-Speak in 1999 was an enabler for e-services Microsoft introduced the name "web services" in June 2000 MS "bet the company" on its web services strategy now every major vendor is a player
SOAP Basics
SOAP is often thought of as a protocol extension for doing Remote Procedure Calls (RPC) over HTTP. This is how it is often used. This is not accurate: SOAP is an XML message format for exchanging structured, typed data. It may be used for RPC in client-server applications May be used to send XML documents Also suitable for messaging systems (like JMS) that follow one-to-many (or publish-subscribe) models. SOAP is not a transport protocol. You must attach your message to a transport mechanism like HTTP.
WSDL
WSDL
Web Server
JDBC DB
DB
Browsers converse with web servers using HTTP GET/POST methods. Servlets or CGI scripts process the parameters and take action, like connect to a DB. Separates visual from non-visual components Interactions may be either through the browser or through a desktop client (Java Swing, Python, Windows, etc.)
XML tagging data such that it can be exchanged between applications and platforms SOAP messaging protocol for transporting information and instructions between applications (uses XML)
WSDL a standard method of describing web services and their specific capabilities (XML) UDDI defines XML-based rules for building directories in which companies advertise themselves and their web services
Advantages
Open, text-based standards Modular approach Inexpensive to implement (relatively) Reduce the cost of enterprise application integration Incremental implementation
WSDL Document
Registry refers client to WSDL document WSDL provides data to interact with web service Web service returns SOAP-message response Client sends SOAP-message request
Client
XML
Developed from Standard Generalized Markup Method (SGML) XML widely supported by W3C Essential characteristic is the separation of content from presentation XML describes only data Any application that understands XML can exchange data
XML
XML parser checks syntax If syntax is good the document is wellformed XML document can optionally reference a Document Type Definition (DTD), also called a Schema If an XML document adheres to the structure of the schema it is valid
SOAP
SOAP enables between distributed systems SOAP message has three parts
envelope wraps entire message and contains header and body header optional element with additional info such as security or routing body application-specific data being commuicated
WSDL
Web services are self-describing Description is written in WSDL, an XMLbased language through which a web service conveys to applications the methods that the service provides and how those methods are accessed WSDL is meant to be read by applications (not humans)