SlideShare una empresa de Scribd logo
1 de 18
Web Services
By
Uma
SOA – Service Oriented Architecture
What is Web Service?
 Web services are client and server applications that
communicate over the World Wide Web’s (WWW) HyperText
Transfer Protocol (HTTP).
 A way of integrating Web-based applications using the
XML, SOAP, WSDL and UDDI open standards over an Internet
protocol backbone.
 Web services can be combined in a loosely coupled way to
achieve complex operations.
 Programs providing simple services can interact with each
other to deliver sophisticated added-value services.
Uses of Web Services
Reusable Application Components
Connect Existing Software
Free Web Services Site
http://www.ezzylearning.com/services/
http://www.webservicex.net/WS/wscatlist.aspx
http://www.gisgraphy.com/free-access.htm
http://www.geonames.org/
REST
WSDL WADL
Categories of Web Services
SOAP Architecture
SOAP
Simple Object Access Protocol (SOAP) is a standard
protocol specification for message exchange based on XML.
Communication between the web service and client
happens using XML messages.
SOAP defines the rules for communication like what are all
the tags that should be used in XML and their meaning.
Apache CXF
 Open Source Services Framework
 Build and develop services using frontend programming
APIs, like JAX-WS and JAX-RS.
 This Services run on different protocols
SOAP, XML/HTTP, RESTful HTTP, or CORBA
 Work on different transports HTTP, JMS or JBI.
What is WSDL?
WSDL stands for Web Services Description Language.
WSDL is a language for describing web services and
how to access them.
WSDL is written in XML.
WSDL definition describes how to access a web
service and what operations it will perform.
WSDL Elements
Types– a container for data type definitions using some type
system (such as XSD).
Message– an abstract, typed definition of the data being
communicated.
Operation– an abstract description of an action supported by
the service.
Port Type–an abstract set of operations supported by one or
more endpoints.
Binding– a concrete protocol and data format specification for
a particular port type.
Port– a single endpoint defined as a combination of a binding
and a network address.
Service– a collection of related endpoints.
How to implement SOAP Web service?
Interfaces & its Implementations
@WebService
public interface ServiceName {
public String serviceMethod1();
public int serviceMethod2(args);
}
@WebService(endpointInterface = " *.Service")
public class ServiceImpl implements Service{
@Override
public String serviceMethod1() {…....}
@Override
Public int serviceMethod2(args){.......}
}
Rest Architecture
REST
 REST is a client-server architecture which (among other things)
leverages the full capacity of the HTTP protocol.
 RESTful webservices use HTTP methods explicitly by mapping
the REST operations to HTTP methods:
Create - POST
Retrieve - GET
Update - PUT
Delete - DELETE
WADL
The Web Application Description Language (WADL) is a
machine-readable XML description of HTTP-based web
applications (typically REST web services).
WADL models the resources provided by a service and the
relationships between them.
 WADL is intended to simplify the reuse of web services that
are based on the existing HTTP architecture of the Web.
Implementation of REST Web service
Service Beans(Class as a Resource)
@Path(“rest”)
Class Resource
{
@GET
@Produces("text/plain")
Public String method1()
{….....}
@GET
@Consumes("application/json")
Public Response method2 ()
{ …....}
}
THANK YOU

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Web services
Web servicesWeb services
Web services
 
WSDL
WSDLWSDL
WSDL
 
Webservices divya 1
Webservices divya 1Webservices divya 1
Webservices divya 1
 
Webservices divya
Webservices divyaWebservices divya
Webservices divya
 
Rest surekha
Rest surekhaRest surekha
Rest surekha
 
Webservices
WebservicesWebservices
Webservices
 
Web services wsdl
Web services wsdlWeb services wsdl
Web services wsdl
 
Web Services
Web Services Web Services
Web Services
 
Web services wsdl
Web services wsdlWeb services wsdl
Web services wsdl
 
Web services
Web servicesWeb services
Web services
 
Web Services - WSDL
Web Services - WSDLWeb Services - WSDL
Web Services - WSDL
 
Web services soap
Web services soapWeb services soap
Web services soap
 
Web services
Web servicesWeb services
Web services
 
WSDL 2.0 and Apache Woden
WSDL 2.0 and Apache WodenWSDL 2.0 and Apache Woden
WSDL 2.0 and Apache Woden
 
Soap web service
Soap web serviceSoap web service
Soap web service
 
Soa 10 soa technology soap
Soa 10 soa technology soapSoa 10 soa technology soap
Soa 10 soa technology soap
 
Soa 9 soa technologies wsdl
Soa 9 soa technologies wsdlSoa 9 soa technologies wsdl
Soa 9 soa technologies wsdl
 
Introduction to SOAP/WSDL Web Services and RESTful Web Services
Introduction to SOAP/WSDL Web Services and RESTful Web ServicesIntroduction to SOAP/WSDL Web Services and RESTful Web Services
Introduction to SOAP/WSDL Web Services and RESTful Web Services
 
CodeMash 2013 Microsoft Data Stack
CodeMash 2013 Microsoft Data StackCodeMash 2013 Microsoft Data Stack
CodeMash 2013 Microsoft Data Stack
 
Java web services
Java web servicesJava web services
Java web services
 

Destacado

The civil war begins
The civil war beginsThe civil war begins
The civil war beginsnrayroberts
 
The civil war begins
The civil war beginsThe civil war begins
The civil war beginsnrayroberts
 
The civil war begins
The civil war beginsThe civil war begins
The civil war beginsnrayroberts
 
Welcome to the Next Level in Sponsorship
Welcome to the Next Level in SponsorshipWelcome to the Next Level in Sponsorship
Welcome to the Next Level in SponsorshipLSRLM
 
The civil war begins final
The civil war begins finalThe civil war begins final
The civil war begins finalnrayroberts
 
3 36764 the_nextlevelofsocialsponsorshipsbymassrelevancemedia
3 36764 the_nextlevelofsocialsponsorshipsbymassrelevancemedia3 36764 the_nextlevelofsocialsponsorshipsbymassrelevancemedia
3 36764 the_nextlevelofsocialsponsorshipsbymassrelevancemediaLSRLM
 
Sales and Marketing Alignment
Sales and Marketing AlignmentSales and Marketing Alignment
Sales and Marketing AlignmentLSRLM
 
Test automationslides
Test automationslidesTest automationslides
Test automationslidesUMA MAHESWARI
 
Networking Fundamentals
Networking FundamentalsNetworking Fundamentals
Networking FundamentalsUMA MAHESWARI
 
Effective Spring Transaction Management
Effective Spring Transaction ManagementEffective Spring Transaction Management
Effective Spring Transaction ManagementUMA MAHESWARI
 

Destacado (12)

Spring aop
Spring aopSpring aop
Spring aop
 
The civil war begins
The civil war beginsThe civil war begins
The civil war begins
 
The civil war begins
The civil war beginsThe civil war begins
The civil war begins
 
The civil war begins
The civil war beginsThe civil war begins
The civil war begins
 
Outline of Android
Outline of AndroidOutline of Android
Outline of Android
 
Welcome to the Next Level in Sponsorship
Welcome to the Next Level in SponsorshipWelcome to the Next Level in Sponsorship
Welcome to the Next Level in Sponsorship
 
The civil war begins final
The civil war begins finalThe civil war begins final
The civil war begins final
 
3 36764 the_nextlevelofsocialsponsorshipsbymassrelevancemedia
3 36764 the_nextlevelofsocialsponsorshipsbymassrelevancemedia3 36764 the_nextlevelofsocialsponsorshipsbymassrelevancemedia
3 36764 the_nextlevelofsocialsponsorshipsbymassrelevancemedia
 
Sales and Marketing Alignment
Sales and Marketing AlignmentSales and Marketing Alignment
Sales and Marketing Alignment
 
Test automationslides
Test automationslidesTest automationslides
Test automationslides
 
Networking Fundamentals
Networking FundamentalsNetworking Fundamentals
Networking Fundamentals
 
Effective Spring Transaction Management
Effective Spring Transaction ManagementEffective Spring Transaction Management
Effective Spring Transaction Management
 

Similar a Web Services Guide: SOAP, REST, WSDL & More

Introduction to webservices
Introduction to webservicesIntroduction to webservices
Introduction to webservicesGagandeep Singh
 
webservices overview
webservices overviewwebservices overview
webservices overviewelliando dias
 
Efficient retrieval of web services using prioritization and clustering
Efficient retrieval of web services using prioritization and clusteringEfficient retrieval of web services using prioritization and clustering
Efficient retrieval of web services using prioritization and clusteringAlexander Decker
 
Cloud computing 20 service modelling
Cloud computing 20 service modellingCloud computing 20 service modelling
Cloud computing 20 service modellingVaibhav Khanna
 
Understanding Web Services by software outsourcing company india
Understanding Web Services by software outsourcing company indiaUnderstanding Web Services by software outsourcing company india
Understanding Web Services by software outsourcing company indiaJignesh Aakoliya
 
Web services for developer
Web services for developerWeb services for developer
Web services for developerRafiq Ahmed
 
Web Services in Cloud Computing.pptx
Web Services in Cloud Computing.pptxWeb Services in Cloud Computing.pptx
Web Services in Cloud Computing.pptxssuser403d87
 
Day1 : web service basics
Day1 :  web service basics Day1 :  web service basics
Day1 : web service basics Testing World
 
Advantage of WCF Over Web Services
Advantage of WCF Over Web ServicesAdvantage of WCF Over Web Services
Advantage of WCF Over Web ServicesSiva Tharun Kola
 
Xml web services
Xml web servicesXml web services
Xml web servicesRaghu nath
 
WebService-Java
WebService-JavaWebService-Java
WebService-Javahalwal
 
Web programming
Web programmingWeb programming
Web programmingsowfi
 
Rest based xml web services
Rest based xml web servicesRest based xml web services
Rest based xml web servicessnegacmr
 
Topic6 Basic Web Services Technology
Topic6 Basic Web Services TechnologyTopic6 Basic Web Services Technology
Topic6 Basic Web Services Technologysanjoysanyal
 
Topic6 Basic Web Services Technology
Topic6 Basic Web Services TechnologyTopic6 Basic Web Services Technology
Topic6 Basic Web Services Technologysanjoysanyal
 

Similar a Web Services Guide: SOAP, REST, WSDL & More (20)

Introduction to webservices
Introduction to webservicesIntroduction to webservices
Introduction to webservices
 
Xml.ppt
Xml.pptXml.ppt
Xml.ppt
 
Web service
Web serviceWeb service
Web service
 
Web services
Web servicesWeb services
Web services
 
webservices overview
webservices overviewwebservices overview
webservices overview
 
Efficient retrieval of web services using prioritization and clustering
Efficient retrieval of web services using prioritization and clusteringEfficient retrieval of web services using prioritization and clustering
Efficient retrieval of web services using prioritization and clustering
 
Cloud computing 20 service modelling
Cloud computing 20 service modellingCloud computing 20 service modelling
Cloud computing 20 service modelling
 
Understanding Web Services by software outsourcing company india
Understanding Web Services by software outsourcing company indiaUnderstanding Web Services by software outsourcing company india
Understanding Web Services by software outsourcing company india
 
Web services for developer
Web services for developerWeb services for developer
Web services for developer
 
Web services
Web servicesWeb services
Web services
 
Web Services in Cloud Computing.pptx
Web Services in Cloud Computing.pptxWeb Services in Cloud Computing.pptx
Web Services in Cloud Computing.pptx
 
Day1 : web service basics
Day1 :  web service basics Day1 :  web service basics
Day1 : web service basics
 
Advantage of WCF Over Web Services
Advantage of WCF Over Web ServicesAdvantage of WCF Over Web Services
Advantage of WCF Over Web Services
 
Xml web services
Xml web servicesXml web services
Xml web services
 
WebService-Java
WebService-JavaWebService-Java
WebService-Java
 
Web Programming
Web ProgrammingWeb Programming
Web Programming
 
Web programming
Web programmingWeb programming
Web programming
 
Rest based xml web services
Rest based xml web servicesRest based xml web services
Rest based xml web services
 
Topic6 Basic Web Services Technology
Topic6 Basic Web Services TechnologyTopic6 Basic Web Services Technology
Topic6 Basic Web Services Technology
 
Topic6 Basic Web Services Technology
Topic6 Basic Web Services TechnologyTopic6 Basic Web Services Technology
Topic6 Basic Web Services Technology
 

Último

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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 WorkerThousandEyes
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 

Último (20)

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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 on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

Web Services Guide: SOAP, REST, WSDL & More

  • 2. SOA – Service Oriented Architecture
  • 3. What is Web Service?  Web services are client and server applications that communicate over the World Wide Web’s (WWW) HyperText Transfer Protocol (HTTP).  A way of integrating Web-based applications using the XML, SOAP, WSDL and UDDI open standards over an Internet protocol backbone.  Web services can be combined in a loosely coupled way to achieve complex operations.  Programs providing simple services can interact with each other to deliver sophisticated added-value services.
  • 4. Uses of Web Services Reusable Application Components Connect Existing Software
  • 5. Free Web Services Site http://www.ezzylearning.com/services/ http://www.webservicex.net/WS/wscatlist.aspx http://www.gisgraphy.com/free-access.htm http://www.geonames.org/
  • 8. SOAP Simple Object Access Protocol (SOAP) is a standard protocol specification for message exchange based on XML. Communication between the web service and client happens using XML messages. SOAP defines the rules for communication like what are all the tags that should be used in XML and their meaning.
  • 9. Apache CXF  Open Source Services Framework  Build and develop services using frontend programming APIs, like JAX-WS and JAX-RS.  This Services run on different protocols SOAP, XML/HTTP, RESTful HTTP, or CORBA  Work on different transports HTTP, JMS or JBI.
  • 10. What is WSDL? WSDL stands for Web Services Description Language. WSDL is a language for describing web services and how to access them. WSDL is written in XML. WSDL definition describes how to access a web service and what operations it will perform.
  • 11.
  • 12. WSDL Elements Types– a container for data type definitions using some type system (such as XSD). Message– an abstract, typed definition of the data being communicated. Operation– an abstract description of an action supported by the service. Port Type–an abstract set of operations supported by one or more endpoints. Binding– a concrete protocol and data format specification for a particular port type. Port– a single endpoint defined as a combination of a binding and a network address. Service– a collection of related endpoints.
  • 13. How to implement SOAP Web service? Interfaces & its Implementations @WebService public interface ServiceName { public String serviceMethod1(); public int serviceMethod2(args); } @WebService(endpointInterface = " *.Service") public class ServiceImpl implements Service{ @Override public String serviceMethod1() {…....} @Override Public int serviceMethod2(args){.......} }
  • 15. REST  REST is a client-server architecture which (among other things) leverages the full capacity of the HTTP protocol.  RESTful webservices use HTTP methods explicitly by mapping the REST operations to HTTP methods: Create - POST Retrieve - GET Update - PUT Delete - DELETE
  • 16. WADL The Web Application Description Language (WADL) is a machine-readable XML description of HTTP-based web applications (typically REST web services). WADL models the resources provided by a service and the relationships between them.  WADL is intended to simplify the reuse of web services that are based on the existing HTTP architecture of the Web.
  • 17. Implementation of REST Web service Service Beans(Class as a Resource) @Path(“rest”) Class Resource { @GET @Produces("text/plain") Public String method1() {….....} @GET @Consumes("application/json") Public Response method2 () { …....} }