Technische universität dortmund Service Computing Service Computing Prof. Dr. Ramin Yahyapour IT & Medien Centrum 24. November 2009.

Slides:



Advertisements
Similar presentations
3rd Annual Plex/2E Worldwide Users Conference Page based on Title Slide from Slide Layout palette. Design is cacorp Title text for Title or Divider.
Advertisements

Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 16 Introduction to Ajax.
REST Vs. SOAP.
Fawaz Ghali AJAX: Web Programming's Toy.
JavaScript and AJAX Jonathan Foss University of Warwick
SE 480: Client Side Scripting Languages Week 10: Ajax Data Sources Copyright © Steven W. Johnson October 1, 2014.
Ajax. Overview of Ajax History In the 1990s, most web sites were based on complete HTML pages; each user action required that the page be re-loaded from.
AJAX Technologies KAUNAS UNIVERSITY OF TECHNOLOGY MODULE: INFORMATION TECHNOLOGY GROUP: IF - 4/9 GROUP: VENTILIATORIAI
6/3/2015eBiquity1 Tutorial on AJAX Anubhav Kale (akale1 AT cs DOT umbc DOT edu)
AJAX Presented by: Dickson Fu Dimas Ariawan Niels Andreassen Ryan Dial Jordan Nielson CMPUT 410 University of Alberta 2006.
Ajax / Rich Internet Applications ICW Lecture 21 Errol Thompson.
Javascript AJAX HTML WEB SERVER Asynchronous. AJAX FUNCTIONS.
1 JavaScript & AJAX CS , Spring JavaScript.
A closer look Dynamic Webpages Jessica Meyerson March 1, 2011.
Chapter 6 DOJO TOOLKITS. Objectives Discuss XML DOM Discuss JSON Discuss Ajax Response in XML, HTML, JSON, and Other Data Type.
JSON (JavaScript Object Notation).  A lightweight data-interchange format  A subset of the object literal notation of JavaScript (or ECMA-262).  A.
The Document Object Model (DOM) & Asynchronous Javascript And XML (AJAX) : an introduction UFCEKG-20-2 : Data, Schemas and Applications.
DHTML. What is DHTML?  DHTML is the combination of several built-in browser features in fourth generation browsers that enable a web page to be more.
Interactive Web Application with AJAX
May 16 – 18, 2007 Copyright 2007, Data Access Worldwide May 16 – 18, 2007 Copyright 2007, Data Access Worldwide Build Great Web Application 'Fast and Easy'
11/13/2007 A synchronous J avaScript A nd X ML Gloria Law Joshua Mahaz.
Lecture 12 – AJAX SFDV3011 – Advanced Web Development Reference: 1.
GIS technologies and Web Mapping Services
ASP.NET + Ajax Jesper Tørresø ITNET2 F08. Ajax Ajax (Asynchronous JavaScript and XML) A group of interrelated web development techniques used for creating.
JavaScript, Fourth Edition Chapter 12 Updating Web Pages with AJAX.
Lecture 13 – XML and JSON SFDV3011 – Advanced Web Development Reference: 1.
06/10/2015AJAX 1. 2 Introduction All material from AJAX – what is it? Traditional web pages and operation Examples of AJAX use Creating.
Instructor, Dr. Khalili Bahram Jeevan Kumar Gogineni.
The Document Object Model. The Web B.D, A.D. They aren’t web pages, they’re document objects A web browser interprets structured information. A server.
Ajax. –Asynchronous JavaScript and XML –Umbrella term for technologies that often: Use client-side scripting for layout and formatting Use less than full.
Weekend MS CS Program Internet and Web Technologies COT 5930 Web Project Development - Ajax Dr. Roy Levow, Associate Chair & Professor
Understanding AJAX Hype, Hope, Hurt and Help for the Web MJTS May 4th, 2006 _________________________ Terence Conklin, Conklin Systems
Fall 2006 Florida Atlantic University Department of Computer Science & Engineering COP 4814 – Web Services Dr. Roy Levow Part 2 – Ajax Fundamentals.
Ajax. –Asynchronous JavaScript and XML –Umbrella term for technologies that often: Use client-side scripting for layout and formatting Use less than full.
Asynchronous Javascript And XML AJAX : an introduction UFCEUS-20-2 : Web Programming.
School of Computing and Information Systems CS 371 Web Application Programming AJAX.
CISC 3140 (CIS 20.2) Design & Implementation of Software Application II Instructor : M. Meyer Address: Course Page:
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
1 Alternative view on Internet Computing Web 1.0 –Web 1.0 is first generation, Web Information based. Driven by Information provider. Web 2.0 Ajax enabled.
the acronym for Asynchronous JavaScript and XML.
Chapter 16: Ajax-Enabled Rich Internet Applications with XML and JSON TP2543 Web Programming Mohammad Faidzul Nasrudin.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
JSON – Java Script Object Notation. What is JSON JSON is a data interchange format Interactive Web 2.0 applications, no more use page replacement. Data.
AJAX and REST. Slide 2 What is AJAX? It’s an acronym for Asynchronous JavaScript and XML Although requests need not be asynchronous It’s not really a.
AJAX – Asynchronous JavaScript And XML By Kranthi Kiran Nuthi CIS 764 Kansas State University.
Web Technology (NCS-504) Prepared By Mr. Abhishek Kesharwani Assistant Professor,UCER Naini,Allahabad.
 AJAX technology  Rich User Experience  Characteristics  Real live examples  JavaScript and AJAX  Web application workflow model – synchronous vs.
AJAX JaxFusion April 2006 David Fekke. Who am I? David Fekke Lead Software Engineer Data Inteligence Group
AJAX CS456 Fall Examples Where is AJAX used? Why do we care?
1 AJAX. AJAX – Whatzit? Asynchronous (content loading)‏ Javascript (logic & control)‏ And XML (request handling)‏
Javascript AJAX HTML WEB SERVER Asynchronous. Javascript HTML events DOM – document object model browser internal view of html page compute.
CITA 330 Section 10 Web Remoting Techniques. Web Remoting Web Remoting is a term used to categorize the technique of using JavaScript to directly make.
NCCUCS 軟體工程概論 Lecture 5: Ajax, Mashups April 29, 2014.
Open Solutions for a Changing World™ Eddy Kleinjan Copyright 2005, Data Access WordwideNew Techniques for Building Web Applications June 6-9, 2005 Key.
Technologies For Creating Rich Internet Applications Presenter's name
1 ODF and Web Mashups Basic techniques Rob Weir, IBM :15.
I NTRO TO W EB TECHNOLOGY Basic terms. C LIENT – S ERVER M ODEL a distributed communication between service requestors and service providers.
DHTML.
JavaScript and Ajax (Ajax Tutorial)
CS 371 Web Application Programming
AJAX and REST.
Application with Cross-Platform GUI
AJAX.
Asynchronous Java script And XML Technology
AJAX.
ISC440: Web Programming 2 AJAX
Introduction to AJAX Sue Brandreth.
JavaScript & jQuery AJAX.
AJAX CS-422 Dick Steflik.
Presentation transcript:

technische universität dortmund Service Computing Service Computing Prof. Dr. Ramin Yahyapour IT & Medien Centrum 24. November 2009

technische universität dortmund SOAP vs REST In REST: <soap:Envelope xmlns:soap=" soap:encodingStyle=" }

technische universität dortmund Beyond static text and forms The current trend in Web applications (Web X.0) more interactivity on the client side (rich applications) "standard GUI behavior", drag & drop, as for stand-alone applications the browser as the central front-end for various types of applications pro: no installation or roll-out costs for new applications con: limitations of browser environment, browser-specifics Different technical approaches covered herein AJAX (as a new paradigm of developing rich browser-based clients) Java Applets and Java WebStart Others: ActiveX objects, Flash (overview) 3 Source. Dietmar Jannach, WT

technische universität dortmund AJAX ? AJAX: stands for Asynchronous JavaScript and XML although XML is not mandatory (see later) Main idea: use asynchronous calls from JavaScript to the Web server dynamically adapt the content on the current page Basic advantages no full reload (submit) of Web page required – individually contents can be "re-loaded" Users can continue to interact while reload takes place (asynchronous calls) Technically: Relies on long-known JavaScript methods Various libraries ('AJAX engines') available that hide the few details of asynchronous data transfer 4 Source. Dietmar Jannach, WT

technische universität dortmund Ajax in 10 seconds function createRequestObject() { var ro; var browser = navigator.appName; if(browser == "Microsoft Internet Explorer"){ ro = new ActiveXObject("Microsoft.XMLHTTP"); } else { ro = new XMLHttpRequest(); } return ro; } var http = createRequestObject(); 5 function sndReq(action) { http.open('get', 'rpc.php?action='+action); http.onreadystatechange = handleResponse; http.send(null); } function handleResponse() { if(http.readyState == 4){ var response = http.responseText; var update = new Array(); if(response.indexOf('|' != -1)) { update = response.split('|'); document.getElementById(update[0]).innerHTML = update[1]; } } } [foo] Source. Dietmar Jannach, WT

technische universität dortmund AJAX in 10 seconds – continued Some PHP script (rpc.php) … switch($_REQUEST['action']) { case 'foo': / do something / echo "foo|foo done"; break;... } 6 The in the HTML page will become foo done

technische universität dortmund Data transfer formats Free choice of server-side technology Proprietary formats can be chosen (see example) Design alternatives Create full HTML at server-side only create the content on the server use XML as a data transfer format? Recent format: JSON lightweight format (compared with XML) notation is compatible with different languages like JavaScript Not yet officially standardized (RFC status) Supported in Web services by Yahoo or Google 7

technische universität dortmund JSON example (json.org) {"addressbook": {"name": "Mary Lebow", "address": { "street": "5 Main Street" "city": "San Diego, CA", "zip": 91912, }, "phoneNumbers": [ " ", " " ] } 8

technische universität dortmund … same in XML Mary Lebow 5 Main Street San Diego, CA

technische universität dortmund The advantage in JavaScript // Remember AJAX call var jsonRaw = http.responseText; var jsonContent = eval ( "(" + jsonRaw + ")" ); document.write("No of Elements: " + jsonContent.addressbook.length); var response = ""; for (i = 0; i< jsonContent.addressbook.length;i++) { response += jsoncontent.addressbook[i].name + " "; response += jsoncontent.addressbook[i].address.city + " "; response += jsoncontent.addressbook[i].address.zip + " br>"; } document.getElementById("addressBookResults").innerHTML = response; 10

technische universität dortmund Pro and con Constraints: JSON does not support namespaces like XML There are no XML - CDATA sections in JSON, there are also no XML attributes Validation cannot be easily done at client side Optimized for client-side consumption in browser (compare Web Services) Advantages No XML parser or complex XML reading required at client side, easy consumption of content Server-side generation of JSON records with libraries possible The syntax is less verbose, thus reducing data transfer 11

technische universität dortmund Potential problems with AJAX Of course, the browser must support JavaScript What about mobile browsers? Bookmarks Allowing the user to set bookmarks on pages is not trivial Back/Forward AJAX calls are not registered in the browser's history Search engine optimization Search engine robots cannot easily index your dynamically constructed page Web page analytics It is a bit more complicated as there are lots of small HTTP requests Finally, the programming model danger of putting business logic to the presentation layer 12

technische universität dortmund Other AJAX techniques Using XMLHttp is not the only option Pro XMLHttp: Easy Potential problem: Accessing content from other sites than the original one Other option: Using frames or (hidden) iFrames No need for XMLHttp method (if not supported by browser) Problems and different behaviour with browser history Different JavaScript API in different browsers to access IFrame content 13

technische universität dortmund IFRAME example – the client function handleResponse(msg) { if (msg == 'server1') document.getElementById("RSIFrame").contentDocument.location.replace("html1.php") ; else document.getElementById("RSIFrame").contentDocument.location.replace("html2.php") ; } <iframe id="RSIFrame" name="RSIFrame" style="width:100px; height:100px; border: 1px solid black" HTML 1 HTML 2 14

technische universität dortmund A "server" (server1.html) window.parent.handleResponse("server1"); Of course … you would use dynamic HTML pages … form data can also be passed, or JavaScript returned … or create frames dynamically with JavaScript … and react on onLoad events 15

technische universität dortmund Using the tag Tag can be used to download any type of information from the server Server can be anywhere! Idea : The "src" attribute of the tag is changed dynamically Potential problems Some encoding required for non-JavaScript code Only GetMethod support for forms Can you trust the code of the service? 16

technische universität dortmund Basic idea Write a web service that returns a JavaScript function m2=bb returning for instance "myfunction({'Value1': 'foo1', 'Value2': 'foo2'}) " Get the code and place it into a script tag function myfunction(params) { alert (params['Value1']); } myfunction(({'Value1': 'foo1', 'Value2': 'foo2'}); API snippet function embedScript(url){ var scriptTag = document.createElement("script"); scriptTag.setAttribute("type", "text/javascript"); scriptTag.setAttribute("src", url); document.getElementsByTagName("head")[0]. appendChild(scriptTag); } 17

technische universität dortmund Modern JavaScript toolkit libraries Goal of these libraries make the programming in JavaScript easier Typical features: Lots of visual effects like fade-in, fade-out AJAX communications Menus, trees,.. shorthand method names for JS functions browser compatibility Examples YUI (Yahoo!), Dojo, Prototype and script.aculo.us, Mochikit, JQuery … Constantly new libraries appear.. 18

technische universität dortmund "Direct RIA" 19 AJAX – based C/S communication hidden by framework Client component renders the content; automatically synchronizes client and server states

technische universität dortmund 20 Net Specific Encryption Application Telnet TCP/UDP IP De/Encryption Network Layer Application Telnet TCP/UDP IP De/Encryption Network Layer Machine AMachine B