Copyright © Steven W. Johnson

Slides:



Advertisements
Similar presentations
TWO STEP EQUATIONS 1. SOLVE FOR X 2. DO THE ADDITION STEP FIRST
Advertisements

You have been given a mission and a code. Use the code to complete the mission and you will save the world from obliteration…
Copyright © 2003 Pearson Education, Inc. Slide 7-1 Created by Cheryl M. Hughes, Harvard University Extension School Cambridge, MA The Web Wizards Guide.
Copyright © 2003 Pearson Education, Inc. Slide 8-1 Created by Cheryl M. Hughes, Harvard University Extension School Cambridge, MA The Web Wizards Guide.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4 The Basics of Javascript Programming the World Wide Web Fourth.
Copyright © 2003 Pearson Education, Inc. Slide 6-1 Created by Cheryl M. Hughes, Harvard University Extension School Cambridge, MA The Web Wizards Guide.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
Chapter 1 The Study of Body Function Image PowerPoint
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 5 Author: Julia Richards and R. Scott Hawley.
1 Copyright © 2010, Elsevier Inc. All rights Reserved Fig 2.1 Chapter 2.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 38.
1 Chapter 40 - Physiology and Pathophysiology of Diuretic Action Copyright © 2013 Elsevier Inc. All rights reserved.
By D. Fisher Geometric Transformations. Reflection, Rotation, or Translation 1.
Business Transaction Management Software for Application Coordination 1 Business Processes and Coordination.
1 Copyright © 2005, Oracle. All rights reserved. Introducing the Java and Oracle Platforms.
Copyright CompSci Resources LLC Web-Based XBRL Products from CompSci Resources LLC Virginia, USA. Presentation by: Colm Ó hÁonghusa.
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
My Alphabet Book abcdefghijklm nopqrstuvwxyz.
0 - 0.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
ADDING INTEGERS 1. POS. + POS. = POS. 2. NEG. + NEG. = NEG. 3. POS. + NEG. OR NEG. + POS. SUBTRACT TAKE SIGN OF BIGGER ABSOLUTE VALUE.
SUBTRACTING INTEGERS 1. CHANGE THE SUBTRACTION SIGN TO ADDITION
MULT. INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
Addition Facts
ZMQS ZMQS
4. Internet Programming ENG224 INFORMATION TECHNOLOGY – Part I
Web Service Testing RESTful Web Services Snejina Lazarova Dimo Mitev
REST and JSON in WCF It is possible to implement and access REST services in WCF And still doing it object oriented This is a short presentation on how.
BT Wholesale October Creating your own telephone network WHOLESALE CALLS LINE ASSOCIATED.
1 WSDL: Web Service Description Language Gary Sharp Mike Breakiron.
ABC Technology Project
Powerpoint Templates Page 1 Powerpoint Templates Server Side Scripting PHP.
Squares and Square Root WALK. Solve each problem REVIEW:
XML INTRODUCTION Prepared by Hongming Yu Modified by Fernando Farfán.
Getting Familiar with Web Pages 1 2 The Internet Worldwide collection of interconnected computer networks that enables businesses, organizations, governments,
Chapter 5 Test Review Sections 5-1 through 5-4.
DB Relay An Introduction. INSPIRATION Database access is WAY TOO HARD The crux.
GG Consulting, LLC I-SUITE. Source: TEA SHARS Frequently asked questions 2.
Addition 1’s to 20.
25 seconds left…...
Week 1.
Chapter 9 Interactive Multimedia Authoring with Flash Introduction to Programming 1.
We will resume in: 25 Minutes.
1 Unit 1 Kinematics Chapter 1 Day
Chapter 11 Describing Process Specifications and Structured Decisions
SE 480: Client Side Scripting Languages Week 10: Ajax Data Sources Copyright © Steven W. Johnson October 1, 2014.
How Cells Obtain Energy from Food
JSON Valery Ivanov.
JSON IDU0075 Sissejuhatus veebiteenustesse.  JSON stands for JavaScript Object Notation  JSON is lightweight text-data interchange format  JSON is.
15-Jul-15 JSON. JSON example “JSON” stands for “JavaScript Object Notation” Despite the name, JSON is a (mostly) language-independent way of specifying.
JSON (JavaScript Object Notation).  A lightweight data-interchange format  A subset of the object literal notation of JavaScript (or ECMA-262).  A.
JSON The Fat Free Alternative to XML. Data Interchange The key idea in Ajax. An alternative to page replacement. Applications delivered as pages. How.
XML in SQL Server Overview XML is a key part of any modern data environment It can be used to transmit data in a platform, application neutral form.
JSON Java Script Object Notation Copyright © 2013 Curt Hill.
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. Ajax  $.get  $.post  $.getJSON  $.ajax  json and xml  Looping over data results, success and error callbacks.
OVERVIEW AND PARSING JSON. What is JSON JavaScript Object Notation Used to format data Commonly used in Web as a vehicle to describe data being sent between.
JSON. JSON as an XML Alternative JSON is a light-weight alternative to XML for data- interchange JSON = JavaScript Object Notation It’s really language.
JSON (Copied from and from Prof Da Silva) Week 12 Web site:
XML & JSON. Background XML and JSON are to standard, textual data formats for representing arbitrary data – XML stands for “eXtensible Markup Language”
JQuery, JSON, AJAX. AJAX: Async JavaScript & XML In traditional Web coding, to get information from a database or a file on the server –make an HTML form.
JSON.
Exporting and Importing Data
Consuming Java Script Object Notation (JSON) feeds
Built in Fairfield County: Front End Developers Meetup
2017, Fall Pusan National University Ki-Joune Li
Department of Computer Science Cal State East Bay, Hayward, CA
JSON: JavaScript Object Notation
Presentation transcript:

Copyright © Steven W. Johnson SE 370: Programming Web Services Week 11: JSON & RESTful Copyright © Steven W. Johnson February 1, 2013

Today: asdf

JSON: REST uses JSON to transmit data

JSON: JavaScript Object Notation Douglas Crockford (2002) JSON: text-based, open data interchange system

JSON: Purpose: data interchange (kavşak) format serialize data for network transmission passes objects as strings from server to client Intention: a light-weight alternative to XML Incorporated into ISO Part of ECMAScript, RFC 4627

JSON: M. C. Escher: (1898 – 1972)

JSON: Basic format of JSON: all data held in square brackets each record held in curly brackets field is made up of: field name in quotes value written appropriate to its data type name/value pairs delimited by commas [ {“name”: value, “name”: “value”}, {“name”: value, “name”: “value”} ]

JSON: JSON formatting options: Ajax format for JSON employees = [ {"firstName":"John", "lastName":"Doe", "age":"18"}, {"firstName":"Peter", "lastName":"Jones", "age":"21"} ]; http://www.json.org/

JSON: REST: each record in curly brackets all records in square brackets array = [{0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11}]; 1 2 3 [0,0] [0,1] [0,2] [0,3] [1,0] [1,1] [1,2] [1,3] [2,0] [2,1] [2,2] [2,3] array[2][1]; //9 array[1][3]; //7 http://www.json.org/

JSON: Each represents the same data; “records” Effectively a database table students = [ {“name”:“Ali”, “age”:”20”, “bolum”:“MBBF” }, {“name”:“Bahar”, “age”:”21”, “bolum”:“ITF” } ]; Students Name Age Bolum Gender Ali 20 MBBF Erkek Bahar 21 ITF Hanim students[1].age //21

JSON: An array of arrays or a database with 2 tables ‘Company’ is DB, tables ‘employees’, ‘managers’ var company = {“employees”: [ { "firstName":"John" , "lastName":"Doe" , "age":"18"}, { "firstName":"Anna" , "lastName":"Smith" , "age":"20"}, { "firstName":"Peter" , "lastName":"Jones" , "age":"21"} ], “managers”: [ { "firstName":"Alice" , "lastName":“Williams" , "age":"19"}, { "firstName":"Carla" , "lastName":“Walker" , "age":"23"}, { "firstName":"Joe" , "lastName":“Evans" , "age":"22"} ] } document.write(company.employees[2].firstName); //Peter document.write(company.managers[1].age); //23

JSON: Update table values also var company = {“employees”: [ { "firstName":"John" , "lastName":"Doe" , "age":"18"}, { "firstName":"Anna" , "lastName":"Smith" , "age":"20"}, { "firstName":"Peter" , "lastName":"Jones" , "age":"21"} ], “managers”: [ { "firstName":“Alice" , "lastName":“Williams" , "age":"19"}, { "firstName":“Carla" , "lastName":“Walker" , "age":"23"}, { "firstName":“Joe" , "lastName":“Evans" , "age":"22"} ] } company.employees[2].firstName= “Steve”;

JSON: x-dimensional array saved as ‘employees’ objname[i]fieldname: { "firstName":"John" , "lastName":"Doe" , "age":18}, { "firstName":"Anna" , "lastName":"Smith" , "age":20}, { "firstName":"Peter" , "lastName":"Jones" , "age":21} ]; document.write(employees[1].age); //20

JSON: JSON supports UTF-8; Notepad doesn’t Must save UTF-8 files using UTF-8, not ANSI

JSON: Derived from JavaScript to represent objects: simple data structures associative arrays parsers available for many languages

JSON: JSON versus XML: “students”= [ {“name”: “Ali”, “age”: “20”, “bolum”: “MBBF”}, {“name”: “Bahar”, “age”: “21”, “bolum”: “ITF”} ] <?xml version=“1.0” encoding=“utf-8”?> <students> <student> <name>Ali</name> <age>20</age> <bolum>MBBF</bolum> <gender>Erkek</gender> </student> <name>Bahar</name> <age>21</age> <bolum>ITF</bolum> <gender>Hanim</gender> </students>

{“firstname”: “Canan”} JSON: MIME type: application/json Extension: .json Basic form: uses name/value pairs JSON can be stored in either .json and .txt ¸ data.txt {“firstname”: “Canan”} firstname = “Canan”; data.json 17 17

JSON advantages: JSON is JavaScript ‘XML’ with anorexia; faster to parse* Easier to write, lightweight, less verbose True data format, not a meta language <name>Steve</name> “name”: “Steve”,

JSON similarities: True for both XML and JSON: language independent cross-platform self-describing human readable hierarchical (data in data, values describing values)

JSON disadvantages: JSON is JavaScript Requires use of ‘eval’ function* Reserved JavaScript keywords can’t be used as element names XML is more familiar, more like HTML XML more precise due to specific DTD XML has better support

JSON: Data types of JSON: (just like JavaScript) number (JavaScript has no ‘float’ and ‘integer’) string Boolean array object null

JSON versus XML: Both describe objects as strings Both are suitable for use in web services Both enjoy broad support, libraries, etc Tools exist to convert Data conversion can easily be done manually <name>Steve</name> “name”: “Steve”,

JSON: <name>Ali</name> Convert XML to JSON: b=indexOf(">") c=lastIndexOf("<") a=indexOf("<") d=lastIndexOf("<") <name>Ali</name> "name"=substr(a+1,b-1) "Ali"=substring(b+1,c) "</"+name+">" String.substr (start, # of characters); String.substring(start, finish);

JSON: <name>Ali</name> Convert XML to JSON: b=indexOf(">") c=lastIndexOf("<") a=indexOf("<") d=lastIndexOf("<") <name>Ali</name> "name"=substr(a+1,b-1) "Ali"=substring(b+1,c) document.write(name, value);

JSON: Convert XML to JSON: <firstname>Ali</firstname> <lastname>Zeybek</lastname> <age>23</age> for (i=0; i<length; i++) { name = String[i].substr(a+1,b-1) value = String[i].substring(b+1,c) document.write("\""+name+"\": \""+value+"\", "); } for (i=0; i<length; i++) { name = String.substr(a+1,b-1) value = String.substring(b+1,c) document.write(name, value); }

Lab: JSON Parser Convert XML to name/value pairs Output: “CustomerNumber”: “3568”, Assume data held in single string ‘data’ <Cust>123</Cust> <First>Ali</First> Data= “<CustomerNumber>7458</CustomerNumber> <FirstName>Elif</FirstName> <Surname>Bardukoglu</Surname> <Discount>5</Discount>”; <CustomerNumber>7458</CustomerNumber> <FirstName>Elif</FirstName> <Surname>Bardukoglu</Surname> <Discount>5</Discount>

Lab: JSON Parser <script> data = "<CustomerNumber>7458</CustomerNumber> <FirstName>Elif</FirstName> <Surname>Bardukoglu</Surname> <Discount>5</Discount>"; var rawdata = data.split(" "); count = rawdata.length; for (i=0; i<count; i++) { namestart = rawdata[i].indexOf("<"); nameend = rawdata[i].indexOf(">"); nametext = rawdata[i].substring(namestart + 1, nameend); valuestart = nameend; valueend = rawdata[i].lastIndexOf("<"); valuetext = rawdata[i].substring(valuestart + 1, valueend); document.write("\""+nametext+"\": \""+valuetext+"\""); if (i < count-1) document.write(", "); } </script>

Break

Lab: JSON Parser Convert JSON to XML: <students> <student> <name>Ali</name> <age>20</age> <bolum>MBBF</bolum> </student> <name>Bahar</name> <age>21</age> <bolum>ITF</bolum> </students> student=[ {"name":"Ali","age":"20","bolum":"MBBF"}, {"name":"Bahar","age":"21","bolum":"ITF"} ];

Lab: JSON Parser Convert JSON to XML: Root element is ‘students’ (not considered) ‘Students’ is root element Text before “=” is like record name Rows are like records; holds field names, values student=[ {"name":"Ali","age":"20","bolum":"MBBF"}, {"name":"Bahar","age":"21","bolum":"ITF"} ];

Lab: JSON Parser Convert JSON to XML: (format is different) Assume no spaces in the ‘data’ student=[{"name":"Ali","age":"20","bolum":"MBBF"},{"name":"Bahar","age":"21","bolum":"ITF"}]; <students> <student> <name>Ali</name> <age>20</age> <bolum>MBBF</bolum> </student> <name>Bahar</name> <age>21</age> <bolum>ITF</bolum> </students>

Lab: JSON Parser Convert JSON to XML: (format is different) replace(“\“:\””, “ “) indexOf(“\””) lastIndexOf(“\””) split(“ ”) replace(“\”,\””, “ “) student=[{"name":"Ali","age":"20","bolum":"MBBF"},{"name":"Bahar","age":"21","bolum":"ITF"}]; name Ali age 20 bolum MBBF"}, {"name Bahar age 21 bolum ITF

Quiz: 1. What is the address of the value 24? [2, 1] 12 16 17 5 8 3 24 33 33

Quiz: 2. Place this array in the table: [[1, 2, 3], [4, 5, 6], [7, 8, 9]] 1 2 3 4 5 6 7 8 9 34 34

Quiz: 3. What XML tag is most like a record? <bbb> <aaa> <bbb> <ccc>data</ccc> <ccc>data</ccc> <ccc>data</ccc> </bbb> </aaa> 35 35

Quiz: 4. From <aaa>, the address of <bbb>? 5. Child nodes of <ccc> 6. What is the root node? <aaa>[0].childNodes[0] <aaa> <aaa> <bbb> <ccc>11</ccc> <ccc>22</ccc> <ccc>33</ccc> </bbb> </aaa> 36 36

Quiz: 7. Children of <aaa>? 1 8. Value of <bbb>[0].childNodes[1].childNodes[0].nodeValue 1 22 <aaa> <bbb> <ccc>11</ccc> <ccc>22</ccc> <ccc>33</ccc> </bbb> </aaa> 37 37

Quiz: 9. JSON array of 3 names: friends = [ {“name”:”Ali”, “name”:”Bahar”, “name”:”Canan”} ]; 38 38

Quiz: 10. What is the value of company.employees[1].age? 20 var company = {“employees”: [ { "firstName":"John" , "lastName":"Doe" , "age":18}, { "firstName":"Anna" , "lastName":"Smith" , "age":20}, { "firstName":"Peter" , "lastName":"Jones" , "age":21} ], “managers”: [ { "firstName":“Alice" , "lastName":“Williams" , "age":19}, { "firstName":“Carla" , "lastName":“Walker" , "age":23}, { "firstName":“Joe" , "lastName":“Evans" , "age":22} ] } 39 39

Copyright © Steven W. Johnson SE 370: Programming Web Services Week 12: JSON Copyright © Steven W. Johnson February 1, 2013

Today: asd

Week 2: Labs: Assignment:

Course textbook: asd

Break

Week 2: Labs: Assignment:

Lab: Hello RESTful Webapps Deploy (rt. Click on project – Deploy) http://localhost:8080/HelloTest/webresources/generic

REST: GET/POST/PUT/DELETE methods of HTTP Requires tomcat Made in maven RESTEasy NetBeans https://netbeans.org/kb/docs/websvc/intro-ws.html http://yiyujia.blogspot.com/2011/09/simple-tutorial-about-creating-jersey.html*** 47

Lab: Web Service using REST Customers in table: @Stateless @Path("customerdb.customer") public class CustomerFacadeREST extends AbstractFacade<Customer> { @PersistenceContext(unitName = "CustomerDBPU") private EntityManager em; public CustomerFacadeREST() { super(Customer.class); } @POST @Override @Consumes({"application/xml", "application/json"}) public void create(Customer entity) { super.create(entity); @PUT public void edit(Customer entity) { super.edit(entity); @DELETE @Path("{id}") public void remove(@PathParam("id") Integer id) { super.remove(super.find(id)); @GET @Produces({"application/xml", "application/json"}) public Customer find(@PathParam("id") Integer id) { return super.find(id); public List<Customer> findAll() { return super.findAll(); @Path("{from}/{to}") public List<Customer> findRange(@PathParam("from") Integer from, @PathParam("to") Integer to) { return super.findRange(new int[]{from, to}); @Path("count") @Produces("text/plain") public String countREST() { return String.valueOf(super.count()); protected EntityManager getEntityManager() { return em;

Lab: Web Service using REST Customers in table: @Stateless @Path("customerdb.customer") public class CustomerFacadeREST extends AbstractFacade<Customer> { @PersistenceContext(unitName = "CustomerDBPU") private EntityManager em; public CustomerFacadeREST() { super(Customer.class); } @POST @Override @Consumes({"application/xml", "application/json"}) public void create(Customer entity) { super.create(entity); @PUT public void edit(Customer entity) { super.edit(entity); @DELETE @Path("{id}") public void remove(@PathParam("id") Integer id) { super.remove(super.find(id)); @GET @Produces({"application/xml", "application/json"}) public Customer find(@PathParam("id") Integer id) { return super.find(id); public List<Customer> findAll() { return super.findAll(); @Path("{from}/{to}") public List<Customer> findRange(@PathParam("from") Integer from, @PathParam("to") Integer to) { return super.findRange(new int[]{from, to}); @Path("count") @Produces("text/plain") public String countREST() { return String.valueOf(super.count()); protected EntityManager getEntityManager() { return em;

Lab: Web Service using REST Create record 14 as yourself {"discountCode":"H","rate":16.00,"customerCollection":[{"customerId":36,"name":"Bob Hosting Corp.","addressline1":"65653 Lake Road","addressline2":"Suite 2323","city":"San Mateo","state":"CA","phone":"650-555-0160","fax":"650-555-0161","email":"www.bobhostcorp.example.com","creditLimit":65000,"discountCode": <?xml version="1.0" encoding="UTF-8"?>    <customers>        <customer>            <addressline1>111 E. Las Olivas Blvd</addressline1>            <addressline2>Suite 51</addressline2>            <city>Fort Lauderdale</city>            <creditLimit>100000</creditLimit>            <customerId>1</customerId>            <discountCode>                <discountCode>78</discountCode>                <rate>0.00</rate>            </discountCode>            <email>jumboeagle@example.com</email>            <fax>305-555-0189</fax>            <name>Jumbo Eagle Corp</name>            <phone>305-555-0188</phone>            <state>FL</state>        </customer> <?xml version="1.0" encoding="UTF-8"?>    <customers>        <customer>            <addressline1>6482 Sokak #33/1</addressline1>            <addressline2>Suite 51</addressline2>            <city>Fort Lauderdale</city>            <creditLimit>100000</creditLimit>            <customerId>14</customerId>            <discountCode>                <discountCode>75</discountCode>                <rate>0.00</rate>            </discountCode>            <email>steve.johnson@gmail.com</email>            <fax>305-555-0189</fax>            <name>Jumbo Eagle Corp</name>            <phone>305-555-0188</phone>            <state>FL</state>        </customer>

Lab: Web Service using REST Create the client application: File – New Project

Lab: Web Service using REST Uncheck ‘Create Main Class’ – Finish

Lab: Web Service using REST Rt. Click Project – New – Entity Classes from Database

Lab: Web Service using REST Add package name - Finish

Lab: Web Service using REST Rt. Click on client project New – Other… - Web Services – RESTful Java Client

Lab: Web Service using REST Create the client application: File – New Project

Copyright © Steven W. Johnson SE 370: Programming Web Services Week 12: JSON Copyright © Steven W. Johnson February 1, 2013

Lab: CRONentry Use CRON to run the client page Asadmin in glassfish-3.1.2.2 – bin http://www.javascool.com/2010/04/15/ejb-timer-service/ rs.next(); int id=921; String customernumber = "ABCD"; String sku = rs.getString("sku"); int qtyordered = rs.getInt("maxstock") - rs.getInt("onhand");

Lab: CRONentry Open ‘Projects’ tab – File – New Project - Java

Lab: CRONentry Name: OrderWS (all server side is ‘order’) Main Class: DBConnect

Lab: CRONentry Gives a class DBConnect /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package orderws; /** * * @author Steve public class DBConnect { * @param args the command line arguments public static void main(String[] args) { // TODO code application logic here }

Lab: CRONentry Connection to DB requires imports: unused import (will be used later) package orderws; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class DBConnect { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here }

Lab: CRONentry Set up the connection string: Error: ‘unreported exception’ (add try/catch: coming) package orderws; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class DBConnect { /** * @param args the command line arguments */ public static void main(String[] args) { String host = “jdbc:derby://localhost:1527/order”; String user = “stevej” String pass = “izmir” Connection con = DriverManager.getConnection(host, user, pass); }

Lab: CRONentry Add try/catch framework: public static void main(String[] args) { try { String host = “jdbc:derby://localhost:1527/order”; String user = “stevej” String pass = “izmir” Connection con = DriverManager.getConnection(host, user, pass); } catch (SQLException err) { System.out.println(err.getMessage());

Lab: CRONentry Add two imports to top These are used to create the query and recordset import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; //import java.sql.ResultSet;

Lab: CRONentry Create INSERT query As written, works on single INSERT only Dummy data added to test format Statement stmt = con.createStatement(); int id = 12; String customernumber = "Server"; String sku = "428575 87412"; int qtyordered = 9; String SQL = "INSERT INTO orderentry VALUES ("+id+", '"+customernumber+"', '"+sku+"', "+qtyordered+")"; stmt.executeUpdate(SQL); System.out.println("Successful Execution");

Today: http://www.vogella.com/articles/REST/article.html http://java.dzone.com/news/simple-restful-web-services http://java.dzone.com/articles/easy-way-expose-java-service http://firstinfinity.wordpress.com/modeling_rest_web_services/** http://rathinasaba.wordpress.com/2010/09/05/restful-web-service-sample-in-tomcat/ http://docs.oracle.com/cd/E21764_01/web.1111/e13734/rest.htm http://docs.oracle.com/cd/E19798-01/821-1841/giepu/index.html http://docs.oracle.com/javaee/6/tutorial/doc/gipzz.html

Implementations of REST Jersey Restlet JBoss RESTEasy Apache CXF Triaxrs Apache Wink eXo

Lab: Web Service using REST Create the client application: File – New Project

Lab: Web Service using REST Create the client application: File – New Project

Lab: Web Service using REST Create the client application: File – New Project

Lab: Web Service using REST Create the client application: File – New Project

REST: REST architecture describes six constraints: client/server model; separation of concerns Stateless: no memory of prior communications Cacheable Layered system: may use intermediary servers Code on demand (optional) Uniform interface (wikipedia) https://en.wikipedia.org/wiki/Representational_state_transfer 73

Lab: Client side of REST DiscountCode.java

Lab: Client side of REST DiscountCode.java

Today: http://www.oracle.com/technetwork/articles/javase/index-137171.html http://www.myeclipseide.com/documentation/quickstarts/webservices_rest/ http://rest.elkstein.org/ http://docs.oracle.com/javaee/6/tutorial/doc/giepu.html http://www.packtpub.com/restful-php-web-services/book http://davidwalsh.name/web-service-php-mysql-xml-json http://www.ibm.com/developerworks/opensource/tutorials/os-php-webservice/ http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.samples.jsonrest.doc%2Fdoc%2Fintroduction.htm

Today: RESTful PHP Web Services’, http://www.packtpub.com/restful-php-web-services/book http://www.slideshare.net/jeremycod/consuming-restful-web-services-in-php http://www.mkyong.com/webservices/jax-rs/jersey-hello-world-example/

Today: http://www.javaworld.com/javaworld/jw-01-2013/130124-web-services-are-dead-long-live-rest.htmlasd http://www.ibm.com/developerworks/web/library/wa-aj-tomcat/ http://drupal.org/node/1860564 http://code.google.com/p/staff/wiki/ExampleCalculatorService https://access.redhat.com/site/documentation/en-US/JBoss_Developer_Studio/4.0/html/JBoss_Web_Services_User_Guide/sample_web_service_wizards-sample_restful_web_service .html RESTEasy installed http://community.jaspersoft.com/wiki/getting-started-rest-web-service-api** http://www.9lessons.info/2012/05/create-restful-services-api-in-php.html PHP http://markroland.com/blog/restful-php-api/ http://phpmaster.com/writing-a-restful-web-service-with-slim/ http://www.xfront.com/REST-Web-Services.html

Today: asd