Java is a general-purpose, class-based, object-oriented computer programming language that was designed by James Gosling at Sun Microsystems in 1995.
Key Highlights of Java:
Platform Independent: This allows programmers to develop applications that can run on any operating system.
Usability of Java: Java is most widely used programming language. It is present everywhere. It really doesn't matter which domain you are working in, you will surely come across Java sooner or later!
Open Source: The good news is that Java is available for free! All the development tools and the environment (JRE & JDK) that is used to develop Java applications are absolutely free of cost.
Android: Irrespective of the fact that you are tech savvy or not, most of us are badly bitten by the Android bug! Android is in great demand today and fortunately you need Java for Android development. Hence, the importance of Java has increased even more.
Hadoop: Hadoop is one of the most trending framework for processing Big Data. It has been designed and developed in Java.
In spite of having a tough competition on the server side from Microsoft and other companies, Java is doing extremely well on mobile platforms, thanks to Android! It has also been the primary language for Hadoop Developers.
Report
Share
Report
Share
1 of 24
Download to read offline
More Related Content
Implementing Web Services In Java
1. Implementing Web Services in Java
www.edureka.co/java-j2ee-soa-training
View Java/J2EE and SOA course details at http://www.edureka.co/java-j2ee-soa-training
For Queries:
Post on Twitter @edurekaIN: #askEdureka
Post on Facebook /edurekaIN
For more details please contact us:
US : 1800 275 9730 (toll free)
INDIA : +91 88808 62004
Email Us : sales@edureka.co
2. www.edureka.co/java-j2ee-soa-trainingSlide 2 Twitter @edurekaIN, Facebook /edurekaIN, use #askEdureka for Questions
Objectives
At the end of this webinar, you will be able to:
Understand SOAP
Implement WSDL
Work Of REST Services
Create a Restful App in JAVA
3. Slide 3 www.edureka.co/java-j2ee-soa-trainingTwitter @edurekaIN, Facebook /edurekaIN, use #askEdureka for Questions
SOAP
SOAP is a protocol to access Web services.
SOAP stands for Simple Object Access Protocol. This protocol is based on XML.
SOAP was designed in 1998 by Dave Winer, Don Box, Bob Atkinson, and Mohsen Al-Ghose.
Request 1 Request 1
Response1 Response1
SOAP
message
context
SOAP
message
context
Handler 1 Handler 2
Client
Request 1
Response1
SOAP
message
context
Handler
Service
SOAP
Service Requester Service Provider
4. Slide 4 www.edureka.co/java-j2ee-soa-trainingTwitter @edurekaIN, Facebook /edurekaIN, use #askEdureka for Questions
SOAP
SOAP stands for Simple Object Access Protocol
SOAP is used for communicating between two applications
SOAP is a format for sending messages
SOAP communicates via Internet using HTTP
SOAP is platform independent
SOAP is written using XML
SOAP is a W3C recommendation
5. Slide 5 www.edureka.co/java-j2ee-soa-trainingTwitter @edurekaIN, Facebook /edurekaIN, use #askEdureka for Questions
SOAP - Example
For example: If we want to get the approval/declined status for credit card transaction from
bank using SOAP, following steps to be done/will be executed:
In client module, write the details about the customer details like credit card, account number,
expiry date, CVV2 etc., in SOAP format.
This SOAP message is sent on web to web service which provides the desired service.
The web service unpacks the SOAP message and converts into a command that the
application can understand. Application will get the credit card information. It does the
required processing and generates the response either approval/declined status in SOAP
message.
This SOAP message is sent back to the client.
Client unpacks the SOAP message and gets the required information.
6. Slide 6 www.edureka.co/java-j2ee-soa-trainingTwitter @edurekaIN, Facebook /edurekaIN, use #askEdureka for Questions
Credit card
account number
expiry date
CVV2
……..
Client Module
SOAP Format
Output in
Web
Web Service
unpacks the SOAP message
and converts into a command
that the application can
understand
SOAP
Message
SOAP – Flow Diagram
7. Slide 7 www.edureka.co/java-j2ee-soa-trainingTwitter @edurekaIN, Facebook /edurekaIN, use #askEdureka for Questions
SOAP Files - WSDL, Client Generation
Server
Java Code - which does the actual operation/provides the service.
WSDL File - Web Service Description Language. This file says the information about the
services like the functions and what input it takes and what output it generates etc.
Client
Using WSDL file, we can generate the client and can execute the web services.
8. Slide 8 www.edureka.co/java-j2ee-soa-trainingTwitter @edurekaIN, Facebook /edurekaIN, use #askEdureka for Questions
Web Services - SOAP
Web Service is published in UDDI registry
UDDI stands for Universal Description, Discovery and Integration
Client looks in the registry for the services and gets connected with the required service and interacts with it
UDDI
Registry
Web
Service
Requestor
Web
Service
Providerinvoke SOAP
register/publish
UDDI
locate/get description
UDDI
11. Slide 11 www.edureka.co/java-j2ee-soa-trainingTwitter @edurekaIN, Facebook /edurekaIN, use #askEdureka for Questions
WSDL
WSDL is Web Services Description Language
WSDL is written in XML and it is a XML document
WSDL describes the Web services
WSDL is a W3C recommendation
12. Slide 12 www.edureka.co/java-j2ee-soa-trainingTwitter @edurekaIN, Facebook /edurekaIN, use #askEdureka for Questions
WSDL
WSDL XML document has the following elements:
<types> - This section is used to specify the data types used by the web services.
<messages> - Messages for communication will be specified in this section. Input message
and output message can be specified in this section.
<portType> - This defines the web service and the operations / methods to be executed.
Also the messages that are involved in this operation /method. Messages could be input
message and output message.
<binding> - This section defines the message bindings and transportation protocol.
<service> - Location of the service – URL.
14. Slide 14 www.edureka.co/java-j2ee-soa-trainingTwitter @edurekaIN, Facebook /edurekaIN, use #askEdureka for Questions
REST Services
REST stands for Representational State Transfer
This service is developed using HTTP protocol
In Rest based architecture, similar to SOAP based Architecture, service is developed in REST
and REST client has to be written to use the REST Service
Java defines REST support via the Java Specification Request (JSR) 311. This specification is
called JAX-RS (The Java API for RESTful Web Services)
15. Slide 15 www.edureka.co/java-j2ee-soa-trainingTwitter @edurekaIN, Facebook /edurekaIN, use #askEdureka for Questions
JAX-RS
Jersey is the reference implementation for JSR (Java Specification Request)-311
Jersey provides the library for RESTful Web Services using Servlet container
Download Jersey distribution from the site: https://jersey.java.net/download.html
16. Slide 16 www.edureka.co/java-j2ee-soa-trainingTwitter @edurekaIN, Facebook /edurekaIN, use #askEdureka for Questions
Restful Services
REST is an architecture. RESTful service is a service which follows the REST architecture.
Following Annotations are used:
» @Path (path) – Sets the path to the base URL. The base URL is the application name,
servlet and URL specified in the web.xml.
» @GET – Indicates the following method will address HTTP GET request.
» @Produces – This function will generate the given output. It could be TEXT/HTML/XML
formats etc.
17. Slide 17 www.edureka.co/java-j2ee-soa-trainingTwitter @edurekaIN, Facebook /edurekaIN, use #askEdureka for Questions
Creating Restful Service
Create a dynamic web project in eclipse.
Add jersey jar files to the build path.
Add the web.xml under web content/WEB-INF directory.
Add a Java file and add the required code of the service.
20. Slide 20 www.edureka.co/java-j2ee-soa-trainingTwitter @edurekaIN, Facebook /edurekaIN, use #askEdureka for Questions
Creating Restful Service
Hello should be added for the path of this service.
Name of the class is Hello.
@GET – The following method will respond to GET method of the client request.
@Produces – This method returns the data specified in the Produces annotation.
Method returns the data.
Run the project so that Service is running on Apache Tomcat.
22. Slide 22 www.edureka.co/java-j2ee-soa-trainingTwitter @edurekaIN, Facebook /edurekaIN, use #askEdureka for Questions
RESTful – Client
Base URL is obtained for the service.
Methods of RESTful services are invoked by using the path and the media type.
Apart from writing the client, service can be tested with the URL too
For example:
» http://localhost:8080/jax_rest2/rest/Hello?name=edureka
» Here, service is running under 8080 port.
Name of the application is jax_rest2, /rest/Hello is the Path and name=edureka
is passed as parameter to this service.