Transcript SOAP
SOAP Overview by Szigyarto Tamas, SPBU Applied Mathematics, Department of Computer Modelling and Multiple Processors Systems Agenda ► Introduction • Software as a service • Starting with the service ► What is SOAP? • SOAP how it is • SOAP messaging framework • Extensibility • SOAP processing model • Protocol binding ► Why SOAP? ► Web Services Solution • What is the Web Service? • Stack of layers • Demo example SOAP -> Introduction -> Software as a service “Software as a service” What is it? • providing unified software, which every customer will able to use • building IT-systems ultimately utility like electricity and gas to provide ability for everyone plug into it • deliver the SOA (Service Oriented Architecture) in the more natural way ‘cause widespread acceptance of the Internet SOAP -> Introduction -> Software as a service Private IT “generating” stations EJB CORBA Broker EJB CORBA Broker EJB CORBA Broker CORBA Broker DCOM DCOM DCOM EJB Today organizations build their own home-grown, large and complex IT “generating” stations using existed technologies like J2EE, CORBA, DCOM and others. Agenda ► Introduction • Software as a service • Starting with the service ► What is SOAP? • SOAP how it is • SOAP messaging framework • Extensibility • SOAP processing model • Protocol binding ► Why SOAP? ► Web Services Solution • What is the Web Service? • Stack of layers • Demo example SOAP -> Introduction -> Starting with the service Service oriented architecture (SOA) • Previously The way a service was created and delivered to the customer was dictated by the available technology • Our goal To start with the service we want to provide and then work backwards into the technology SOAP -> Introduction -> Starting with the service Delivering SOA Choosing the technology Providing Service Natural way to provide SOA is to reverse above trend Working under Service we want to provide Backwards into the technology SOAP -> Introduction -> Starting with the service Delivering SOA (2) The quote from IBM: ”So it (SOA) basically boils down to distributed computing with standards that tell us how to invoke different applications as services in a secure and reliable way and then how we can link the different services together using choreography to create business processes. And then finally so that we can manage these services so that ultimately we can manage and monitor our business performance.” Resume: while this is technologically valid, it is missing the point of SOA – we are focused on the technology that enables SOA and not on SOA itself. Agenda ► Introduction • Software as a service • Starting with the service ► What is SOAP? • SOAP how it is • SOAP messaging framework • Extensibility • SOAP processing model • Protocol binding ► Why SOAP? ► Web Services Solution • What is the Web Service? • Stack of layers • Demo example SOAP -> What Is SOAP? -> SOAP how it is SOAP philosophy • SOAP is stands by Simple Object Access Protocol • SOAP is a simple and flexible messaging framework for transferring information specified in the form of an XML infoset between an initial SOAP sender and ultimate SOAP receiver • SOAP does not define any application semantics but defines the mechanism to express application messaging semantics SOAP -> What Is SOAP? -> SOAP how it is SOAP philosophy (2) More formal SOAP definition: SOAP is a lightweight protocol intended for exchanging structured information in a decentralized, distributed environment. SOAP uses XML technologies to define an extensible messaging framework, which provides a message construct that can be exchanged over a variety of underlying protocols. The framework has been designed to be independent of any particular programming model and other implementation specific semantics. SOAP -> What Is SOAP? -> SOAP how it is SOAP terminology • Node: Enforcing the rules that govern the exchange of SOAP messages. It accesses the services provided by the underlying protocols through one or more SOAP bindings • Role: A SOAP node’s expected function in message processing • Binding: Formal set of rules for carrying a SOAP message within or on the top of another protocol (underlying protocol) for the purpose of exchange • SOAP Application: Software entity that produces, consumes or otherwise acts upon SOAP message in a manner conforming to the SOAP processing model • Message path: Set of SOAP nodes through which a single SOAP message passes Agenda ► Introduction • Software as a service • Starting with the service ► What is SOAP? • SOAP how it is • SOAP messaging framework • Extensibility • SOAP processing model • Protocol binding ► Why SOAP? ► Web Services Solution • What is the Web Service? • Stack of layers • Demo example SOAP -> What Is SOAP? -> SOAP messaging framework SOAP messages Standard SOAP message: Envelope <?xml version=“1.0”?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/ envelope/> <soap:Header> <!-- optional --> <!-- header blocks go here... --> </soap:Header> <soap:Body> <!-- payload or Fault element goes here--> </soap:Body> </soap:Envelope> Header: Contains requirements specific to message optional Body: Information used by application (object data, error messages, return values) required SOAP -> What Is SOAP? -> SOAP messaging framework SOAP request Example of the SOAP message that represents a request to transfer funds between bank accounts: <?xml version=“1.0”?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <x:TransferFunds xmlns:x="urn:examples-org:banking"> <from>22-342439</from> <to>98-283843</to> <amount>100.00</amount> </x:TransferFunds> </soap:Body> </soap:Envelope> SOAP -> What Is SOAP? -> SOAP messaging framework SOAP response Response : <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <x:TransferFundsResponse xmlns:x="urn:examples-org:banking"> <balances> <account> <id>22-342439</id> <balance>33.45</balance> </account> <account> <id>98-283843</id> <balance>932.73</balance> </account> </balances> </x:TransferFundsResponse> </soap:Body> </soap:Envelope> SOAP -> What Is SOAP? -> SOAP messaging framework SOAP fault codes Name Meaning VersionMismatch The processing party found an invalid namespace for the SOAP Envelope element MustUnderstand An immediate child element of the SOAP Header element that was either not understood or not obeyed by the processing party contained a SOAP mustUnderstand attribute with a value of ”1” Client The Client class of errors indicates that the message was incorrectly formed or didn’t contain the appropriate information in order to succeed. It is generally an indication that the message should not be resent without change Server The Server class of errors indicates that the message could not be processed for reasons not directly attributable to the contents of the message, but rather to the processing of the message. For example, processing could include communicating with an upstream processor, which didn’t respond. The message may succeed if re-sent at a later point in time SOAP -> What Is SOAP? -> SOAP messaging framework SOAP fault example The following sample SOAP message contains Fault element that indicates an “Insufficient Funds” error occurred while processing the previous request: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>Insufficient funds</faultstring> <detail> <x:TransferError xmlns:x="urn:examples-org:banking"> <sourceAccount>22-342439</sourceAccount> <transferAmount>100.00</transferAmount> <currentBalance>89.23</currentBalance> </x:TransferError> </detail> </soap:Fault> </soap:Body> </soap:Envelope> Agenda ► Introduction • Software as a service • Starting with the service ► What is SOAP? • SOAP how it is • SOAP messaging framework • Extensibility • SOAP processing model • Protocol binding ► Why SOAP? ► Web Services Solution • What is the Web Service? • Stack of layers • Demo example SOAP -> What Is SOAP? -> Extensibility SOAP Header • Header element, like the Body element, is a generic container for control information • Elements placed in the Header are referred to as header blocks • Header should contain information that influences payload processing • Header is the right place to put some credential information that helps control access to the operation SOAP -> What Is SOAP? -> Extensibility SOAP Header (example) This example related to our previous example dedicated to bank accounts: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <!-- security credentials --> <s:credentials xmlns:s="urn:examples-org:security“ mustUnderstand=“1”> <username>dave</username> <password>evad</password> </s:credentials> </soap:Header> <soap:Body> <x:TransferFunds xmlns:x="urn:examples-org:banking"> <from>22-342439</from> <to>98-283843</to> <amount>100.00</amount> </x:TransferFunds> </soap:Body> </soap:Envelope> SOAP -> What Is SOAP? -> Processing Model Simple messaging scenario • SOAP defines a processing model that outlines rules for processing a SOAP message as it travels from SOAP sender to a SOAP receiver Agenda ► Introduction • Software as a service • Starting with the service ► What is SOAP? • SOAP how it is • SOAP messaging framework • Extensibility • SOAP processing model • Protocol binding ► Why SOAP? ► Web Services Solution • What is the Web Service? • Stack of layers • Demo example SOAP -> What Is SOAP? -> Processing Model Sophisticated SOAP messaging • However, SOAP processing model allows for more interesting architectures, which contains multiple intermediary nodes SOAP -> What Is SOAP? -> Processing Model Intermediaries nodes • while processing a message, a SOAP node assumes one or more roles that influence how SOAP header is processed • roles are given unique names (in the form of URIs), so they can be identified during processing <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <wsrp:path xmlns:wsrp="http://schemas.xmlsoap.org/rp" soap:actor="http://schemas.xmlsoap.org/soap/actor/next" soap:mustUnderstand="1" > ... SOAP -> What Is SOAP? -> Processing Model SOAP 1.2 Roles SOAP role name Description http://www.w3.org/2002/06/soapenvelope/role/next Each SOAP intermediary and the ultimate SOAP receiver MUST act in this role and MAY additionally assume zero or more other SOAP roles http://www.w3.org/2002/06/soapenvelope/role/none SOAP nodes MUST NOT act in this role http://www.w3.org/2002/06/soapenvelope/role/ultimateReceiver To establish itself as an ultimate SOAP receiver, a SOAP node MUST act in this role. SOAP intermediaries MUST NOT act in this role Remark: SOAP 1.1 defines only one role next. Every node must acts as next role Agenda ► Introduction • Software as a service • Starting with the service ► What is SOAP? • SOAP how it is • SOAP messaging framework • Extensibility • SOAP processing model • Protocol binding ► Why SOAP? ► Web Services Solution • What is the Web Service? • Stack of layers • Demo example SOAP -> What Is SOAP? -> Protocol Bindings Protocol Bindings • each intermediary could choose to use different communication protocol without affecting the SOAP message • standard protocol binding is required to ensure high level of interoperability across SOAP applications and infrastructure • a concrete protocol binding defines exactly how SOAP message should be transmitted with given protocol • it defines the details of how SOAP fits within the scope of another protocol, which probably has its own messaging framework with a variety of headers SOAP -> What Is SOAP? -> Protocol Bindings SOAP HTTP Bindings SOAP 1.1 specification only codifies a protocol binding for HTTP, due to its wide use Remark: the context type header for both HTTP request and response messages must be set to txt/xml (application/soap+xml in SOAP 1.2) Agenda ► Introduction • Software as a service • Starting with the service ► What is SOAP? • SOAP how it is • SOAP messaging framework • Extensibility • SOAP processing model • Protocol binding ► Why SOAP? ► Web Services Solution • What is the Web Service? • Stack of layers • Demo example SOAP -> Why SOAP? Industry acceptance for SOAP • developers have been able to download and use the technology, rather than just read specifications and industry analysis • SOAP changes both the way software will be developed and the way industry rivals and cooperating • many of the key industry software leaders have announced their support for SOAP, including, HP, SAP, Software AG, Sun Microsystems, and Oracle • Microsoft and IBM have lead to the release of Web Services platform, with SOAP services being the core technology in the initial releases • emergence of Web Services Definition Language (WSDL) and Universal Description, Discovery and Integration (UDDI) SOAP -> Why SOAP? SOAP transport Most of SOAP servers currently use HTTP as the transport protocol for the XML payload in SOAP message ‘cause HTTP satisfies a number of requirements: • Ubiquity • Firewall friendliness • Simplicity • Scalability • Readily capable of being secure There are a number of SOAP implementations that support other transport layers, such as • HTTPS – using SSL provides security • SMTP – enables asynchronous SOAP requests / SOAP report It can be expected that other transport protocols, such as MSMQ or FTP, will be supported eventually. IBM has an interesting for HTTPR to provide a reliable transport layer for SOAP messages SOAP -> Why SOAP? SOAP extensibility SOAP defines a communication framework that allows for such features to be added down the road as layered extensions. Microsoft, IBM and other software vendors working out a common suite of SOAP extensions that will add many of these features that most developers expect. SOAP extensibility is key. SOAP -> Why SOAP? Enterprise Application Integration (EAI) • There has been considerable speculation that current Enterprise Application Integration (EAI) products will be made redundant by SOAP. • But, there is still a role for heavy-duty, enterprise-grade EAI products that integrate with more obscure legacy systems or provide unusually high qualities of service. • Significant: SOAP will encourage and enable a whole new generation of EAI projects that were not previously possible due to technical and cost constraints. SOAP -> Why SOAP? SOAP: advantages and disadvantages Advantages • Human readable XML • Easy to debug • SOAP runs over HTTP • Firewalls not affected • Services can be written in any language, platform or operating system Disadvantages • S-L-O………………..-W • XML produces a lot of overhead for small messages • Web Services speed relies on Internet traffic conditions • Not strictly-typed XML Agenda ► Introduction • Software as a service • Starting with the service ► What is SOAP? • SOAP how it is • SOAP messaging framework • Extensibility • SOAP processing model • Protocol binding ► Why SOAP? ► Web Services Solution • What is the Web Service? • Stack of layers • Demo example SOAP -> Web Services Solution -> What Is the Web Service? What about definition? Each software vendor defines Web Service in a slightly different way: Gartner: “WS is loosely coupled software components that interact with one another dynamically via standard Internet technology.” Forrest Research: “WS is a formatted connection between people, systems and applications, that expose elements of business functionality as a software service and create new business value.” Common feature: WS is components that you can use, re-use, mix, and match to enhance Internet and Intranet applications. SOAP -> Web Services Solution -> What Is the Web Service? At the basic level Web Service is: • universal client/server architecture that allows disparate systems to communicate with each other without using proprietary client libraries • architecture that simplifies the development process typically associated with client/server applications by effectively eliminating code dependencies between client and server • architecture where server interface information is disclosed to the client via a configuration file encoded in a standard format (WSDL). Doing so allows the server to publish a single file for all target client platforms Agenda ► Introduction • Software as a service • Starting with the service ► What is SOAP? • SOAP how it is • SOAP messaging framework • Extensibility • SOAP processing model • Protocol binding ► Why SOAP? ► Web Services Solution • What is the Web Service? • Stack of layers • Demo example SOAP -> Web Services Solution -> Stack of Layers What’s from WebServices.org? Layer Example Service Negotiation Treading partner agreement Workflow, discovery and Register UDDI (Universal Description, Discovery & Integration) Service description language WSDL (Web Services Definition Language) Messaging SOAP Transport protocol HTTP, HTTPS, SMTP Business Issues Management, Quality of service, Security, Open standards SOAP -> Web Services Solution -> Stack of Layers Interaction with Web Service SOAP -> Web Services Solution -> Stack of Layers Accessing & publication Agenda ► Introduction • Software as a service • Starting with the service ► What is SOAP? • SOAP how it is • SOAP messaging framework • Extensibility • SOAP processing model • Protocol binding ► Why SOAP? ► Web Services Solution • What is the Web Service? • Stack of layers • Demo example SOAP -> Web Services Solution -> Example Demo service main page SOAP -> Web Services Solution -> Example Demo service method call page SOAP -> Web Services Solution -> Example SOAP request SOAP -> Web Services Solution -> Example SOAP response SOAP -> Web Services Solution -> Example HTTP POST request and response SOAP -> Web Services Solution -> Example 2 + 3 = what’s the answer? SOAP -> Web Services Solution -> Example Simple VB script client Something go wrong Everything alright With your message SOAP -> Web Services Solution -> Example Everything alright? But, where’s my answer? Don’t worry! Here is!!! SOAP -> Web Services Solution -> Example What’s go wrong? Here’s the answer: Thank you for your attention!!! Case studies Mother’s cakes Little Red Riding Hood How we can help Little Red Riding Hood reach the grandma with mother’s cakes? Grandma