19
Web Services Part 1 -- Qinwei Zhu Part 2 – Yongqun He

Web Services Part 1 -- Qinwei Zhu Part 2 – Yongqun He

Embed Size (px)

Citation preview

Page 1: Web Services Part 1 -- Qinwei Zhu Part 2 – Yongqun He

Web Services

Part 1 -- Qinwei ZhuPart 2 – Yongqun He

Page 2: Web Services Part 1 -- Qinwei Zhu Part 2 – Yongqun He

What Are Web Services?

Web services are a new breed of Web application. They are self-contained, self-describing, modular applications that can be published, located, and invoked across the Web.

Page 3: Web Services Part 1 -- Qinwei Zhu Part 2 – Yongqun He

Generic Web Service Architecture

Page 4: Web Services Part 1 -- Qinwei Zhu Part 2 – Yongqun He

Why we use Web Services? The Web provides a uniform and widely

accessible interface and access glue over services.

Web service providers can use the Internet to market their services to a potentially huge set of possible clients.

For clients, it can mean quicker and more flexible application development.(all the wording)

Page 5: Web Services Part 1 -- Qinwei Zhu Part 2 – Yongqun He

Examples of Web Services

Microsoft Passport: a convenient authentication service used in Hotmail

A credit checking service that returns credit information when given a person's social security number.

A stock quote service that returns the stock price associated with a specified ticker symbol.

Page 6: Web Services Part 1 -- Qinwei Zhu Part 2 – Yongqun He

Web Services Platform= XML + HTTPOr= XML + HTTP + SOAP + WSDL + UDDLOr= XML + HTTP + SOAP + WSDL + UDDL+XAML + XLANG + XFS +……

Page 7: Web Services Part 1 -- Qinwei Zhu Part 2 – Yongqun He

                                                                                                        

                                                                                      

Page 8: Web Services Part 1 -- Qinwei Zhu Part 2 – Yongqun He

SOAP Simple Object Access Protocol – is

a protocol specification that defines a uniform way of passing XML-encoded data SOAP envelop SOAP header SOAP body

Page 9: Web Services Part 1 -- Qinwei Zhu Part 2 – Yongqun He

POST /StockQuote HTTP/1.1 Host: www.stockquoteserver.com Content-Type: text/xml; charset="utf-8" Content-Length: nnnn SOAPAction: "Some-URI"

<SOAP-ENV:Envelope   xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/

SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body>        <m:GetLastTradePrice xmlns:m="Some-URI">            <symbol>DIS</symbol>        </m:GetLastTradePrice>    </SOAP-ENV:Body>

</SOAP-ENV:Envelope>

Page 10: Web Services Part 1 -- Qinwei Zhu Part 2 – Yongqun He

HTTP/1.1 200 OK Content-Type: text/xml; charset="utf-8" Content-Length: nnnn

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>

<SOAP-ENV:Body>        <m:GetLastTradePriceResponse xmlns:m="Some-URI">            <Price>34.5</Price>        </m:GetLastTradePriceResponse>

</SOAP-ENV:Body> </SOAP-ENV:Envelope>

Page 11: Web Services Part 1 -- Qinwei Zhu Part 2 – Yongqun He

UDDI Universal Description, Discovery

and Integration – provides a mechanism for clients to dynamicaly find other web services

Page 12: Web Services Part 1 -- Qinwei Zhu Part 2 – Yongqun He

UDDI White pages: Information such as the

name, address, telephone number, and other contact information of a given business.

Yellow pages: Information that categorizes businesses. This is based on existing(non-electronic) standards.

Green pages: Technical information about the Web services provided by a given business.

Page 13: Web Services Part 1 -- Qinwei Zhu Part 2 – Yongqun He

UDDI schema

Page 14: Web Services Part 1 -- Qinwei Zhu Part 2 – Yongqun He

Registry APIs (SOAP Messages)

• Inquiry API– Find things

• find_business

• find_service

• find_binding

• find_tModel

– Get Details about things• get_businessDetail

• get_serviceDetail

• get_bindingDetail

• get_tModelDetail

• Publishers API– Save things

• save_business

• save_service

• save_binding

• save_tModel

– Delete things• delete_business

• delete_service

• delete_binding

• delete_tModel

– security…• get_authToken

• discard_authToken

Page 15: Web Services Part 1 -- Qinwei Zhu Part 2 – Yongqun He

e.g.1<find_business generic="2.0" xmlns=um:uddi-org:api-v2"> <name>Books%</name> </find_business>

e.g.2 (?) ( and return result……)<get_serviceDetail generic="2.0" xmlns=um:uddi-org:api-v2"> <serviceKey>"2AB346C0-2282-43B0-756B-0003CC35CC1D“

</name> </get_serviceDetail>

Page 16: Web Services Part 1 -- Qinwei Zhu Part 2 – Yongqun He

<tModel authorizedName="..." operator="..." tModelKey="..."><name>StockQuote Service</name><description xml:lang="en">WSDL description of a standard stock quote service interface</description><overviewDoc><description xml:lang="en">WSDL source document.</description>

<overviewURL> http://stockquote-definitions/stq.wsdl</overviewURL>

</overviewDoc><categoryBag><keyedReference tModelKey="uuid:C1ACF26D-9672-4404-9D70-

39B756E62AB4"keyName="uddi-org:types"keyValue="wsdlSpec"/></categoryBag></tModel>

Page 17: Web Services Part 1 -- Qinwei Zhu Part 2 – Yongqun He

WSDL Web Services Description Language

Service – a collection of ports Port – a single endpoint defined as a

combination of a binding and a network address

Binding – a concrete protocol and data format specification for particular port type

Port type – an abstract set of operations supported by one or more endpoints

Operation – an abstraction description of an action

And so on…

Page 18: Web Services Part 1 -- Qinwei Zhu Part 2 – Yongqun He

WSDL There are tools available to read a

WSDL file and generate the code required to communicate with an XML web service Apache AXIS: generating Java

stubs/skeletons given a WSDL file Microsoft Visual Studio .NET

Page 19: Web Services Part 1 -- Qinwei Zhu Part 2 – Yongqun He

References http://www.uddi.org http://java.sun.com/webservices/ http://www.xml.com/lpt/a/2001/04/04/webservi

ces/index.html http://www-106.ibm.com/developerworks/webs

ervices/