Introduction to Web Services: Definitions and Basic Standards
210 likes | 236 Views
Learn the basics of web services, including definitions, SOAP, WSDL, and UDDI. Understand XML, SOAP messages, WSDL elements, and the advantages of UDDI for seamless integration.
Introduction to Web Services: Definitions and Basic Standards
E N D
Presentation Transcript
Introduction to Web Services Presented by Sarath Chandra Dorbala
Outline • Definitions • Basic Standards • SOAP • WSDL • UDDI
Definitions • A Web Service is a software component that is described via WSDL and is capable of being accessed via standard network protocols such as but not limited to SOAP over HTTP.www.oasis-open.org/committees/wsia/glossary/wsia-draft-glossary-03.htm • The W3C defines a Web service as a software system designed to support interoperable Machine to Machine interaction over a network. http://en.wikipedia.org/wiki/Web_service • An Internet hosted application controlled through SOAP requests which returns results as SOAP responses. http://www.gateway2sms.com/glossary.asp
Basic Standards • XML • All web service documents are written in XML • XML Schemas are used to define elements used in Web Service communication • SOAP • Communication is done over SOAP (typically) • Request and responses messages are encoded in SOAP • The body of the message is contained with in SOAP envelope • Binds the client to the web service
WSDL • Describes the web service and defines functions that are exposed in the web service • Defines SOAP message format • UDDI • UDDI is used to register and look up services with a central registry • Service Providers can publish information about their business and the services that they offer • Service consumers can look up services that are available by • Business • Service category • Specific service
SOAP • Stands for Simple Object Access Protocol • It is a platform independent, XML bases communication protocol for message exchanging between applications
Elements of SOAP message • SOAP is a XML document with the following elements • Envelope • Used to identify the SOAP message • Header (Optional) • This element contains header. For this course this part is important for incorporating security into web services • Body • This element contains call and response information • Fault (Optional) • This element contains details about processing errors
Skeleton SOAP Message <?xml version="1.0"?> <soap:Envelope xmlns: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>
Sample SOAP Message SOAP Request POST /InStock HTTP/1.1 Host: www.example.org Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> <soap:Body xmlns:m="http://www.example.org/stock"> <m:GetStockPrice> <m:StockName>IBM</m:StockName> </m:GetStockPrice> </soap:Body> </soap:Envelope>
SOAP Response HTTP/1.1 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> <soap:Body xmlns:m="http://www.example.org/stock"> <m:GetStockPriceResponse> <m:Price>34.5</m:Price> </m:GetStockPriceResponse> </soap:Body> </soap:Envelope>
WSDL • WSDL stands for Web Service Description Language • It is an XML Document that describes a web service • It specifies the location of the service and operations it exposes
Elements of WSDL • <portType> • It describes a web service, the operations that can be performed, and the messages that are involved. • <message> • Defines the data elements of an operation. Eg, Parameters to the function call parameters • <types> • Defines the data types used by the web service • <binding> • Defines the message format and protocol bindings for each port
Skeleton WSDL Document <definitions> <types> definition of types........ </types> <message> definition of a message.... </message> <portType> definition of a port....... </portType> <binding> definition of a binding.... </binding> </definitions>
UDDI • UDDI stands for Universal Description, Discovery and Integration • UDDI is a platform-independent framework for describing services, discovering businesses, and integrating business services by using the Internet.
Advantages of UDDI • Finding the right business from millions • Defines how to enable e-commerce once business is found • Describing services and business processes programmatically in a single, open and secure environment.
Conclusions • We have seen the essential components of a Web Service. • We have seen the brief overview of these components that form the building blocks of a web service
Recommendations • Examine the real WSDL documents and realize its components • Here is a sample WSDL http://cs.odu.edu/~sdorbala/wsdl/joft.wsdl • Tutorials for creating web services both in .NET and in Java are available http://cs.odu.edu/~sdorbala/ws/JavawebInstr.pdf http://cs.odu.edu/~sdorbala/ws/instructions_net2003.pdf
References • http://wikipedia.org/wiki/Web_service • http://w3schools.com