SlideShare a Scribd company logo
1 of 16
WEB
SERVICES
Web Service
A Web Service is can be defined by following:
• It is a client-server application or application
component for communication.
• The method of communication between two
devices over the network.
• It is a software system for the interoperable
machine to machine communication.
• It is a collection of standards or protocols for
exchanging information between two devices or
application.
Components of Web Services
XML:
Stands for Extensible Markup Language. It is used to tag the data.
SOAP:
Stands for Simple Object Access Protocol. It is used to transfer the data.
UDDI:
Stands for Universal Description, Discovery and Integration. It is used for listing
what services are available
WSDL:
Stands for Web Services Description Language. It is used for describing the
services available.
Types of Web Services
There are two types of web services.
- SOAP: SOAP stands for Simple Object Access Protocol. SOAP is an XML
based industry standard protocol for designing and developing web
services. Since it’s XML based, it’s platform and language independent.
So our server can be based on JAVA and client can be on .NET, PHP etc.
and vice versa.
- REST: REST is an architectural style for developing web services. It’s
getting popularity recently because it has small learning curve when
compared to SOAP.
Java Web Services
There are two main API's defined by Java for developing web service applications
since JavaEE 6.
1) JAX-WS: JAX-WS stands for Java API for XML Web Services. JAX-WS is XML
based Java API to build web services server and client application. There are
two ways to write JAX-WS application code: by RPC style and Document
style.
2) JAX-RS: Java API for RESTful Web Services (JAX-RS) is the Java API for
creating REST web services. JAX-RS uses annotations to simplify the
development and deployment of web services. There are mainly 2
implementation for creating JAX-RS application: Jersey and RESTeasy.
Creating a Web Service from WSDL
- Begin with WSDL for building a web service either by implementing already defined by
standard or existing instance of service
- The JAX-WS wsimport tool processes the existing WSDL document, either from a local copy
or from a network address/ URL.
- To create a web service from WSDL, create the following source files:
 WSDL File
 Web Service Implementation File
 custom-server.xml
 web.xml
 sun-jaxws.xml
 build.xml
 build.properties
standard files
required for JAX-WS
files are standard in
any Ant build
environment
Creating a Web Service from WSDL…
WSDL File
<wsp:Policy wsu:Id="AddNumbers_policy">
<wsp:ExactlyOne>
<wsp:All>
<wsrm:RMAssertion>
<wsrm:InactivityTimeout Milliseconds="600000"/>
<wsrm:AcknowledgementInterval Milliseconds="200"/>
</wsrm:RMAssertion>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
Creating a Web
Service from
WSDL…
if (number1 < 0 || number2 < 0) {
String message = "Negative number cannot be added!";
String detail = "Numbers: " + number1 + ", " + number2;
AddNumbersFault fault = new AddNumbersFault ();
fault.setMessage (message);
fault.setFaultInfo (detail);
throw new AddNumbersFault_Exception(message, fault);
}
return number1 + number2;
}
public void oneWayInt(int number) {
System.out.println("Service received: " + number);
}
}
Web Service Implementation File
import javax.jws.WebService;
import javax.jws.WebMethod;
@WebService (endpointInterface=
"fromwsdl.server.AddNumbersPortType")
public class AddNumbersImpl{
@WebMethod(action="addNumbers")
public int addNumbers (int number1, int
number2)
throws AddNumbersFault_Exception
{
Publishing a Web service
Prerequisites:
- Register with a registry,
- Launch the Web Services Explorer,
- Add the registry to the Web Services Explorer,
- Create a Web service,
- Deploy the Web service,
- Publish a Business Entity.
Publishing a Web service…
Web services are published using two different publication formats: simple and
advanced.
Publish a business service using the simple option:
• In the Web Services Explorer, select UDDI Main and select the registry to which
the users want to publish the business entity.
• In the Actions pane toolbar, click the Publish icon Picture of the Publish icon.
• Select Service and select the Simple radio button.
• Enter the publish URL, your user ID, password, WSDL URL, service name, and
• Service description in the respective fields.
• Click Go to publish your business entity.
Publishing a Web service…
Publish a Web service using the advanced option:
 In the Actions pane toolbar, click the Publish icon Picture of the Publish icon.
 Select Service and select the Advanced radio button.
 Enter the publish URL, your user ID, password, and WSDL URL in the respective fields.
 Click Get or Find to associate the service with a business entity.
 Click Get or Find to associate a specific service interface with the service.
 Click Add to create service names.
Publishing a Web service…
 Click Add to create service descriptions.
 Click Add to create categories. Enter your service categories. Select a category type
from the drop down list.
 Click Browse to open the Categories pane.
 Navigate through the hierarchical taxonomy and select the appropriate
 classification for your business service, then exit the Categories pane.
 Click Go to publish your business entity
Testing a web service
The loosely coupled nature of web services and non-existence of a User
interface present a challenge to the developers and testers alike.
Following are some of the challenges:
 Scalability and Security,
 Absence of User Interface,
 Distributed across network
 Testing the service
Types of testing
Proof of concept Testing
- Used for making sure that the architecture that we have chosen for our application is a correct one.
Functional testing
- This type of testing validates whether the service performs the intended function correctly, does it handle the
exception conditions gracefully and does it handle the boundary value conditions.
Regression testing
- Regression testing aims to ensure that the web service is still working across builds or releases. This sort of
testing needs to be carried out during each release; hence it is an ideal candidate for automation.
Load testing
- Load or stress testing is a test of the performance of the web service when many simultaneous users are
accessing the system. The response of the web service must be consistent and also its performance must not
degrade with the increase in the number of users.
Types of testing…
Unit testing
- Unit test cases must be written before the application is developed. As and when the application is built, test
cases are applied on the code. Hence the functionality is verified as and when we develop the web service.
Basic testing
- The main aim of this testing is to test whether the web service is accessible and can be invoked properly.
Testing SOA
- As organizations create a web service interface to their systems and overcome security issues, they will be
able to exchange data with business entities such as customers, suppliers and partners in a more uninhibited
and loosely coupled manner
Interoperability testing
- In the loosely coupled environment of a service-oriented architecture, separate sources don't need to know the
details of each other’s working, but they need to have enough common ground for reliably exchanging
messages without error or misunderstanding.
Web Service

More Related Content

Similar to Web Services.pptx

Introduction to soapui and webservices
Introduction to soapui  and webservicesIntroduction to soapui  and webservices
Introduction to soapui and webservicesAnil Yadav
 
Testing soapui
Testing soapuiTesting soapui
Testing soapuiF K
 
Application integration framework & Adaptor ppt
Application integration framework & Adaptor pptApplication integration framework & Adaptor ppt
Application integration framework & Adaptor pptAditya Negi
 
Web services and SOA [Modified]
Web services and SOA [Modified]Web services and SOA [Modified]
Web services and SOA [Modified]Subin Sugunan
 
Exposing EJBs As Web Services
Exposing EJBs As Web ServicesExposing EJBs As Web Services
Exposing EJBs As Web ServicesSubin Sugunan
 
Microservices - Hitchhiker's guide to cloud native applications
Microservices - Hitchhiker's guide to cloud native applicationsMicroservices - Hitchhiker's guide to cloud native applications
Microservices - Hitchhiker's guide to cloud native applicationsStijn Van Den Enden
 
SOA Fundamentals
SOA  FundamentalsSOA  Fundamentals
SOA Fundamentalsabhi1112
 
Unit 3-SOA Technologies
Unit 3-SOA TechnologiesUnit 3-SOA Technologies
Unit 3-SOA Technologiesssuser3a47cb
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...WebStackAcademy
 
Fundamentals of Web Development For Non-Developers
Fundamentals of Web Development For Non-DevelopersFundamentals of Web Development For Non-Developers
Fundamentals of Web Development For Non-DevelopersLemi Orhan Ergin
 
web services-May 25.ppt
web services-May 25.pptweb services-May 25.ppt
web services-May 25.pptShivaangiKrish
 
Detailed information on webservice by websoles
Detailed information on webservice by websolesDetailed information on webservice by websoles
Detailed information on webservice by websolesNAVEEN KUMAR SHARMA
 
Web services Tutorial /Websoles Strategic Digital Solutions
Web services Tutorial /Websoles Strategic Digital SolutionsWeb services Tutorial /Websoles Strategic Digital Solutions
Web services Tutorial /Websoles Strategic Digital SolutionsRatnesh Pandey
 
Best Web services tutorial | Websoles Strategic Digital Solutions
Best Web services tutorial | Websoles Strategic Digital SolutionsBest Web services tutorial | Websoles Strategic Digital Solutions
Best Web services tutorial | Websoles Strategic Digital SolutionsShubham Kumar Singh
 
Continuous Integration and Continuous Delivery to Facilitate Web Service Testing
Continuous Integration and Continuous Delivery to Facilitate Web Service TestingContinuous Integration and Continuous Delivery to Facilitate Web Service Testing
Continuous Integration and Continuous Delivery to Facilitate Web Service TestingCognizant
 

Similar to Web Services.pptx (20)

Introduction to soapui and webservices
Introduction to soapui  and webservicesIntroduction to soapui  and webservices
Introduction to soapui and webservices
 
Testing soapui
Testing soapuiTesting soapui
Testing soapui
 
Web service architecture
Web service architectureWeb service architecture
Web service architecture
 
Application integration framework & Adaptor ppt
Application integration framework & Adaptor pptApplication integration framework & Adaptor ppt
Application integration framework & Adaptor ppt
 
Testing soapui
Testing soapuiTesting soapui
Testing soapui
 
Web services and SOA [Modified]
Web services and SOA [Modified]Web services and SOA [Modified]
Web services and SOA [Modified]
 
Exposing EJBs As Web Services
Exposing EJBs As Web ServicesExposing EJBs As Web Services
Exposing EJBs As Web Services
 
Microservices - Hitchhiker's guide to cloud native applications
Microservices - Hitchhiker's guide to cloud native applicationsMicroservices - Hitchhiker's guide to cloud native applications
Microservices - Hitchhiker's guide to cloud native applications
 
SOA Fundamentals
SOA  FundamentalsSOA  Fundamentals
SOA Fundamentals
 
C09
C09C09
C09
 
Unit 3-SOA Technologies
Unit 3-SOA TechnologiesUnit 3-SOA Technologies
Unit 3-SOA Technologies
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 
Fundamentals of Web Development For Non-Developers
Fundamentals of Web Development For Non-DevelopersFundamentals of Web Development For Non-Developers
Fundamentals of Web Development For Non-Developers
 
Java web services
Java web servicesJava web services
Java web services
 
web services-May 25.ppt
web services-May 25.pptweb services-May 25.ppt
web services-May 25.ppt
 
Detailed information on webservice by websoles
Detailed information on webservice by websolesDetailed information on webservice by websoles
Detailed information on webservice by websoles
 
Web services Tutorial /Websoles Strategic Digital Solutions
Web services Tutorial /Websoles Strategic Digital SolutionsWeb services Tutorial /Websoles Strategic Digital Solutions
Web services Tutorial /Websoles Strategic Digital Solutions
 
Web services | Websoles
Web services | WebsolesWeb services | Websoles
Web services | Websoles
 
Best Web services tutorial | Websoles Strategic Digital Solutions
Best Web services tutorial | Websoles Strategic Digital SolutionsBest Web services tutorial | Websoles Strategic Digital Solutions
Best Web services tutorial | Websoles Strategic Digital Solutions
 
Continuous Integration and Continuous Delivery to Facilitate Web Service Testing
Continuous Integration and Continuous Delivery to Facilitate Web Service TestingContinuous Integration and Continuous Delivery to Facilitate Web Service Testing
Continuous Integration and Continuous Delivery to Facilitate Web Service Testing
 

Recently uploaded

(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 

Recently uploaded (20)

(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 

Web Services.pptx

  • 2. Web Service A Web Service is can be defined by following: • It is a client-server application or application component for communication. • The method of communication between two devices over the network. • It is a software system for the interoperable machine to machine communication. • It is a collection of standards or protocols for exchanging information between two devices or application.
  • 3. Components of Web Services XML: Stands for Extensible Markup Language. It is used to tag the data. SOAP: Stands for Simple Object Access Protocol. It is used to transfer the data. UDDI: Stands for Universal Description, Discovery and Integration. It is used for listing what services are available WSDL: Stands for Web Services Description Language. It is used for describing the services available.
  • 4. Types of Web Services There are two types of web services. - SOAP: SOAP stands for Simple Object Access Protocol. SOAP is an XML based industry standard protocol for designing and developing web services. Since it’s XML based, it’s platform and language independent. So our server can be based on JAVA and client can be on .NET, PHP etc. and vice versa. - REST: REST is an architectural style for developing web services. It’s getting popularity recently because it has small learning curve when compared to SOAP.
  • 5. Java Web Services There are two main API's defined by Java for developing web service applications since JavaEE 6. 1) JAX-WS: JAX-WS stands for Java API for XML Web Services. JAX-WS is XML based Java API to build web services server and client application. There are two ways to write JAX-WS application code: by RPC style and Document style. 2) JAX-RS: Java API for RESTful Web Services (JAX-RS) is the Java API for creating REST web services. JAX-RS uses annotations to simplify the development and deployment of web services. There are mainly 2 implementation for creating JAX-RS application: Jersey and RESTeasy.
  • 6. Creating a Web Service from WSDL - Begin with WSDL for building a web service either by implementing already defined by standard or existing instance of service - The JAX-WS wsimport tool processes the existing WSDL document, either from a local copy or from a network address/ URL. - To create a web service from WSDL, create the following source files:  WSDL File  Web Service Implementation File  custom-server.xml  web.xml  sun-jaxws.xml  build.xml  build.properties standard files required for JAX-WS files are standard in any Ant build environment
  • 7. Creating a Web Service from WSDL… WSDL File <wsp:Policy wsu:Id="AddNumbers_policy"> <wsp:ExactlyOne> <wsp:All> <wsrm:RMAssertion> <wsrm:InactivityTimeout Milliseconds="600000"/> <wsrm:AcknowledgementInterval Milliseconds="200"/> </wsrm:RMAssertion> </wsp:All> </wsp:ExactlyOne> </wsp:Policy>
  • 8. Creating a Web Service from WSDL… if (number1 < 0 || number2 < 0) { String message = "Negative number cannot be added!"; String detail = "Numbers: " + number1 + ", " + number2; AddNumbersFault fault = new AddNumbersFault (); fault.setMessage (message); fault.setFaultInfo (detail); throw new AddNumbersFault_Exception(message, fault); } return number1 + number2; } public void oneWayInt(int number) { System.out.println("Service received: " + number); } } Web Service Implementation File import javax.jws.WebService; import javax.jws.WebMethod; @WebService (endpointInterface= "fromwsdl.server.AddNumbersPortType") public class AddNumbersImpl{ @WebMethod(action="addNumbers") public int addNumbers (int number1, int number2) throws AddNumbersFault_Exception {
  • 9. Publishing a Web service Prerequisites: - Register with a registry, - Launch the Web Services Explorer, - Add the registry to the Web Services Explorer, - Create a Web service, - Deploy the Web service, - Publish a Business Entity.
  • 10. Publishing a Web service… Web services are published using two different publication formats: simple and advanced. Publish a business service using the simple option: • In the Web Services Explorer, select UDDI Main and select the registry to which the users want to publish the business entity. • In the Actions pane toolbar, click the Publish icon Picture of the Publish icon. • Select Service and select the Simple radio button. • Enter the publish URL, your user ID, password, WSDL URL, service name, and • Service description in the respective fields. • Click Go to publish your business entity.
  • 11. Publishing a Web service… Publish a Web service using the advanced option:  In the Actions pane toolbar, click the Publish icon Picture of the Publish icon.  Select Service and select the Advanced radio button.  Enter the publish URL, your user ID, password, and WSDL URL in the respective fields.  Click Get or Find to associate the service with a business entity.  Click Get or Find to associate a specific service interface with the service.  Click Add to create service names.
  • 12. Publishing a Web service…  Click Add to create service descriptions.  Click Add to create categories. Enter your service categories. Select a category type from the drop down list.  Click Browse to open the Categories pane.  Navigate through the hierarchical taxonomy and select the appropriate  classification for your business service, then exit the Categories pane.  Click Go to publish your business entity
  • 13. Testing a web service The loosely coupled nature of web services and non-existence of a User interface present a challenge to the developers and testers alike. Following are some of the challenges:  Scalability and Security,  Absence of User Interface,  Distributed across network  Testing the service
  • 14. Types of testing Proof of concept Testing - Used for making sure that the architecture that we have chosen for our application is a correct one. Functional testing - This type of testing validates whether the service performs the intended function correctly, does it handle the exception conditions gracefully and does it handle the boundary value conditions. Regression testing - Regression testing aims to ensure that the web service is still working across builds or releases. This sort of testing needs to be carried out during each release; hence it is an ideal candidate for automation. Load testing - Load or stress testing is a test of the performance of the web service when many simultaneous users are accessing the system. The response of the web service must be consistent and also its performance must not degrade with the increase in the number of users.
  • 15. Types of testing… Unit testing - Unit test cases must be written before the application is developed. As and when the application is built, test cases are applied on the code. Hence the functionality is verified as and when we develop the web service. Basic testing - The main aim of this testing is to test whether the web service is accessible and can be invoked properly. Testing SOA - As organizations create a web service interface to their systems and overcome security issues, they will be able to exchange data with business entities such as customers, suppliers and partners in a more uninhibited and loosely coupled manner Interoperability testing - In the loosely coupled environment of a service-oriented architecture, separate sources don't need to know the details of each other’s working, but they need to have enough common ground for reliably exchanging messages without error or misunderstanding.