Web Services Big Picture Client Network Server ---------------------------------------------------- Marriott http Google Maps web site https Bing Maps build a web page Yahoo Maps out of "parts" ------------------------------------------------------ Uses of the Web 1) Human (Browser) <- I want HTML, CSS, JavaScript (Web Pages) <- Web Appl 2) Program (Java code?) <- I want XML, JSON, Text (Data) <- Web Service Types of Web Services 1) SOAP -> XML as the data transfer format the orginal Web Service "heavy" when using XML, I can encrypt the document I can use HTTPS I can sign the document I have XML Schemas I have WS- inter-operation standards I can compose a response out of "parts" are well documented, using wsdl (Web Service Description Language) file 2) REST -> JSON as the data transfer format the new kid on the block "light" are not well documented, there is no "standard" for documenting REST style Web Services most sites build HTML pages I can use HTTPS ----------------------------------------------- On the Server-Side I have an "Endpoint" which is the URL the client will access the code on the endpoint will call "back-end" code (like Databases) to do the work and the endpoint must now convert the Java object from the back-end into XML/JSON and send that data (XML/JSON) to the client the Web Service endpoint will... convert incoming request XML/JSON to Java (I can use JAXB to map Java to JSON/XML) call the back-end convert the response from Java to XML/JSON (I can use JAXB to map JSON/XML to Java) send that response to the client ---------------------------------------------------- Web Services are "Stateless" <- each call is stand-alone If the client needs to remember "Stuff" between calls, that is up to the client ----------------------------------------------------- On the Client-Side, I make a request to the Endpoint, passing data as needed wait for the response, process the response data as needed use the data