You are on page 1of 2

Aspect SOAP Web Services RESTful Web Services

SOAP (Simple Object Access REST (Representational State


Framework/Protocol
Protocol) Transfer)

@Path (at class level), @GET, @POST,


Annotations @WebService, @WebMethod
@PUT, @DELETE (at method level)

Autogenerated by NetBeans
WSDL (Web Services Not applicable (REST doesn't use
based on the service endpoint
Description Language) WSDL).
interface.

Data Format XML JSON, XML, Plain Text, etc.

Done through method parameters Parameters: @PathParam,

Input/Output Handling and return types, defined in the @QueryParam, @FormParam, etc.

WSDL. Output: Return type of the method.

Built-in support for SOA principles REST architecture inherently supports

Enabling SOA through WSDL and service SOA by treating server components as

contracts. stateless resources.

Custom exception classes, Exceptions can be handled using

annotated with @WebFault. SOAP JAX-RS Exception Mappers


Exception Handling
Faults used for handling (@Provider). HTTP response codes

exceptions. indicate errors.

Can be integrated with JPA for Direct integration with JPA. Entities

JPA Integration database operations. Entities are can be returned directly, and JAX-RS

typically transformed to XML. providers handle serialization.


Use NetBeans wizard to create Use NetBeans to create a RESTful

new Web Service, define service from scratch or from an


Service Creation in NetBeans
operations, NetBeans generates existing database. Annotation-driven

WSDL. design.

REST services can be tested using


SOAP UI or similar tools can be
Testing and Debugging browser extensions, command-line
used for testing SOAP services.
tools like cURL, or REST clients.

Typically HTTP/S, but can be


Transport Protocol HTTP/S is used for REST services.
others (like SMTP) in SOAP.

You might also like