SlideShare a Scribd company logo
1 of 22
REST, JSON, SOAP and XML Processing ,[object Object]
[object Object],[object Object]
Every request to a  REST web service happens in complete isolation
Resources are manipulated by exchanging representations of the resources
REST web services typically allow for the resource representation to be in a format selected by the client at the time of the request
Using : ,[object Object],[object Object]
[object Object],[object Object]
To retrieve a resource, use  GET .
To change the state of a resource or to update it, use  PUT .
To remove or delete a resource, use  DELETE . ,[object Object]
Client application : Uses the  Cache-Control  response header to determine whether to cache the resource (make a local copy of it) or not. A 304 HTTP response code means the client can safely use a cached ,[object Object],[object Object]
Hide the server-side scripting technology file extensions, Substitute spaces with hyphens or underscores, Avoid query strings as much as you can, Instead of using the 404 code always provide a default page or resource as a response
[object Object]
[object Object],[object Object]
Such web services  can be JAX-WS web services or REST web services
JSON text  can be dynamically executed as JavaScript
JSON  is not as verbose as XML while retaining some of the flexibility and extensibility
[object Object]
[object Object]
[object Object],[object Object],[object Object]
A caching infrastructure can be leveraged for performance
The service producer and service consumer have a mutual understanding of the context and content being passed along

More Related Content

What's hot

What's hot (20)

Introduction to RESTful Webservices in JAVA
Introduction to RESTful Webservices  in JAVA Introduction to RESTful Webservices  in JAVA
Introduction to RESTful Webservices in JAVA
 
RESTful Web Services with JAX-RS
RESTful Web Services with JAX-RSRESTful Web Services with JAX-RS
RESTful Web Services with JAX-RS
 
RestFull Webservices with JAX-RS
RestFull Webservices with JAX-RSRestFull Webservices with JAX-RS
RestFull Webservices with JAX-RS
 
Thinking restfully
Thinking restfullyThinking restfully
Thinking restfully
 
ملخص تقنية تصميم صفحات الويب - الوحدة السادسة
ملخص تقنية تصميم صفحات الويب - الوحدة السادسةملخص تقنية تصميم صفحات الويب - الوحدة السادسة
ملخص تقنية تصميم صفحات الويب - الوحدة السادسة
 
RIA and Ajax
RIA and AjaxRIA and Ajax
RIA and Ajax
 
Ado
AdoAdo
Ado
 
RESTEasy
RESTEasyRESTEasy
RESTEasy
 
The Glory of Rest
The Glory of RestThe Glory of Rest
The Glory of Rest
 
AD & LDAP
AD & LDAPAD & LDAP
AD & LDAP
 
JAX-RS 2.0 and OData
JAX-RS 2.0 and ODataJAX-RS 2.0 and OData
JAX-RS 2.0 and OData
 
LDAP
LDAPLDAP
LDAP
 
RESTful Web Services with Jersey
RESTful Web Services with JerseyRESTful Web Services with Jersey
RESTful Web Services with Jersey
 
Web service
Web serviceWeb service
Web service
 
Bdc Screens
Bdc ScreensBdc Screens
Bdc Screens
 
The Ldap Protocol
The Ldap ProtocolThe Ldap Protocol
The Ldap Protocol
 
IR with lucene
IR with luceneIR with lucene
IR with lucene
 
Introduction to SharePoint 2013 REST API
Introduction to SharePoint 2013 REST APIIntroduction to SharePoint 2013 REST API
Introduction to SharePoint 2013 REST API
 
Ldap
LdapLdap
Ldap
 
Easy rest service using PHP reflection api
Easy rest service using PHP reflection apiEasy rest service using PHP reflection api
Easy rest service using PHP reflection api
 

Viewers also liked (9)

SCBCD 2. differenze stateless stateful
SCBCD 2. differenze stateless   statefulSCBCD 2. differenze stateless   stateful
SCBCD 2. differenze stateless stateful
 
Design Pattern 5. Singleton Pattern
Design Pattern 5. Singleton PatternDesign Pattern 5. Singleton Pattern
Design Pattern 5. Singleton Pattern
 
SCDJWS 1. xml schema
SCDJWS 1. xml schemaSCDJWS 1. xml schema
SCDJWS 1. xml schema
 
SCDJWS 2. Soap
SCDJWS 2. SoapSCDJWS 2. Soap
SCDJWS 2. Soap
 
2. wiring beans
2. wiring beans2. wiring beans
2. wiring beans
 
SPRING 1. overview
SPRING 1. overviewSPRING 1. overview
SPRING 1. overview
 
SCDJWS 3. WSDL
SCDJWS 3. WSDLSCDJWS 3. WSDL
SCDJWS 3. WSDL
 
SCDJWS 4. UDDI
SCDJWS 4. UDDISCDJWS 4. UDDI
SCDJWS 4. UDDI
 
Design Pattern 4. Factory Pattern
Design Pattern 4. Factory PatternDesign Pattern 4. Factory Pattern
Design Pattern 4. Factory Pattern
 

Similar to SCDJWS 6. REST JAX-P

Xml web services
Xml web servicesXml web services
Xml web services
Raghu nath
 

Similar to SCDJWS 6. REST JAX-P (20)

Rest web service
Rest web serviceRest web service
Rest web service
 
WIT UNIT-5.pdf
WIT UNIT-5.pdfWIT UNIT-5.pdf
WIT UNIT-5.pdf
 
Web services for developer
Web services for developerWeb services for developer
Web services for developer
 
Unit 2
Unit 2Unit 2
Unit 2
 
Xml.ppt
Xml.pptXml.ppt
Xml.ppt
 
PDFArticle
PDFArticlePDFArticle
PDFArticle
 
Xml web services
Xml web servicesXml web services
Xml web services
 
53 hui homework2
53 hui homework253 hui homework2
53 hui homework2
 
The introduction of RESTful
The introduction of RESTful The introduction of RESTful
The introduction of RESTful
 
Web Programming
Web ProgrammingWeb Programming
Web Programming
 
Restful web services by Sreeni Inturi
Restful web services by Sreeni InturiRestful web services by Sreeni Inturi
Restful web services by Sreeni Inturi
 
SCDJWS 5. JAX-WS
SCDJWS 5. JAX-WSSCDJWS 5. JAX-WS
SCDJWS 5. JAX-WS
 
The RESTful Soa Datagrid with Oracle
The RESTful Soa Datagrid with OracleThe RESTful Soa Datagrid with Oracle
The RESTful Soa Datagrid with Oracle
 
Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)
 
Ajax
AjaxAjax
Ajax
 
Document Databases & RavenDB
Document Databases & RavenDBDocument Databases & RavenDB
Document Databases & RavenDB
 
RIA Data and Security, 2007
RIA Data and Security, 2007RIA Data and Security, 2007
RIA Data and Security, 2007
 
Networked APIs with swift
Networked APIs with swiftNetworked APIs with swift
Networked APIs with swift
 
Hatkit Project - Datafiddler
Hatkit Project - DatafiddlerHatkit Project - Datafiddler
Hatkit Project - Datafiddler
 
WS-Addressing: Enabling Transport-Neutral Message Addressing and Correlation
WS-Addressing: Enabling Transport-Neutral Message Addressing and CorrelationWS-Addressing: Enabling Transport-Neutral Message Addressing and Correlation
WS-Addressing: Enabling Transport-Neutral Message Addressing and Correlation
 

Recently uploaded

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 

SCDJWS 6. REST JAX-P

  • 1.
  • 2.
  • 3. Every request to a REST web service happens in complete isolation
  • 4. Resources are manipulated by exchanging representations of the resources
  • 5. REST web services typically allow for the resource representation to be in a format selected by the client at the time of the request
  • 6.
  • 7.
  • 8. To retrieve a resource, use GET .
  • 9. To change the state of a resource or to update it, use PUT .
  • 10.
  • 11.
  • 12. Hide the server-side scripting technology file extensions, Substitute spaces with hyphens or underscores, Avoid query strings as much as you can, Instead of using the 404 code always provide a default page or resource as a response
  • 13.
  • 14.
  • 15. Such web services can be JAX-WS web services or REST web services
  • 16. JSON text can be dynamically executed as JavaScript
  • 17. JSON is not as verbose as XML while retaining some of the flexibility and extensibility
  • 18.
  • 19.
  • 20.
  • 21. A caching infrastructure can be leveraged for performance
  • 22. The service producer and service consumer have a mutual understanding of the context and content being passed along
  • 23. Bandwidth is particularly important and needs to be limited. PDAs and mobile phones
  • 24.
  • 25. The architecture must address complex nonfunctional requirements
  • 26. The architecture needs to handle asynchronous processing and invocation
  • 27.
  • 28.
  • 29. Clients are AJAX clients.
  • 30. Bandwidth usage needs to be minimized
  • 31.
  • 32. Better tooling is required
  • 33. Reuse of existing data structure definitions is desired
  • 34.
  • 35. supports the Extensible Stylesheet Language Transformations (XSLT) standard
  • 36. JAXP also provides namespace support, allowing you to work with DTDs that might otherwise have naming conflicts
  • 37.
  • 38. SAXParser  : The SAXParser interface defines several kinds of parse() methods
  • 39. SAXReaderIt is the SAXReader that carries on the conversation with the SAX event handlers you define
  • 40.
  • 41. ContentHandler  : are invoked when an XML tag is recognized
  • 42. ErrorHandler  : are invoked in response to various parsing errors
  • 43. DTDHandler  : Defines methods you will generally never be called upon to use
  • 44.
  • 45. With a pull parser, you get the next node, whatever it happens to be, at any point in the code that you ask for it
  • 46. SAX requires much less memory than DOM, because SAX does not construct an internal representation
  • 48. SAX Example public static void main(String argv[]) { // Use an instance of ourselves as the SAX event handler DefaultHandler handler = new Echo(); // Use the default (non-validating) parser SAXParserFactory factory = SAXParserFactory.newInstance(); try { // Set up output stream out = new OutputStreamWriter(System.out, "UTF8"); // Parse the input SAXParser saxParser = factory.newSAXParser(); saxParser.parse(new File(argv[0]), handler); } catch (Throwable t) { t.printStackTrace(); } }
  • 49.
  • 50. DocumentBuilder.newDocument() : method to create an empty Document that implements the org.w3c.dom.Document interface
  • 51.
  • 52. allows extreme flexibility in parsing, navigating, and updating the contents of a document
  • 53. high memory requirements and the need for more powerful processing capabilities
  • 55. DOM Example public static void buildDom() { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); try { DocumentBuilder builder = factory.newDocumentBuilder(); document = builder.newDocument(); Element root = (Element) document.createElement("rootElement"); document.appendChild(root); root.appendChild(document.createTextNode("Some")); root.appendChild(document.createTextNode(" ")); root.appendChild( document.createTextNode("text") ); } catch (ParserConfigurationException pce) { // Parser with specified options can't be built pce.printStackTrace();}}
  • 56.
  • 57.
  • 58.
  • 59. javax.xml.transform.sax  : Defines the SAXSource and SAXResult classes, which let you use a SAX event generator as input to a transformation, or deliver SAX events as output to a SAX event processor
  • 60.
  • 62. XSLT Example Example : j avax.xml.transform.dom Document document; try { File f = new File(argv[0]); DocumentBuilder builder = factory.newDocumentBuilder(); document = builder.parse(f); // Use a Transformer for output TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = tFactory.newTransformer(); DOMSource source = new DOMSource(document); StreamResult result = new StreamResult(System.out); transformer.transform(source, result); }
  • 63.
  • 64.
  • 65. the cursor API is more efficient.
  • 66. XML processing pipelines, use the iterator API
  • 67. modify the event stream, use the iterator API
  • 68.
  • 69. is that StAX is difficult to use if you return XMLdocuments that follow complex schema
  • 70.