REST vs SOAP Web Services ,
=============================================================
=============================================================
=============================================================
=============================================================
A RESTful approach to Web services.
REST vs SOAP Web Services
difference between rest and soap web services
What are the difference between a REST-based Web Services
--
Anish
Core Java,J2EE,JSP,Servlet,JDBC,EJB,Struts,Webservices,,Restfull Web services,J2ee,Spring,Hibernate,Oracle,SQLPlus,EJB3.0,PLSQL,IOC,Spring MVC,ClearCase/ClearQuest,Axis,Jaxws,Eclipse,Jdev,Nebeaans,Ruby,Rails,Stored Procedure,Weblogic,Weblogic Integration,Tocat5.o,JavaEE,bea Tuxedo,SVN,Quality Center,Jboss,RDBMS,telecom BSS,VAS,Maven,Ant,MVC framework,Oc4j,Enterprise Architect,JPA,WLI,JSTL,Telecom Billing,SOAP,WSDL,gdb,Adsense
google Analytics
Showing posts with label WebServices. Show all posts
Showing posts with label WebServices. Show all posts
Friday, August 20, 2010
RESTfull webservice, Using Jboss Resteasy folder Structure
RESTeasy is deployed as a WAR archive and thus depends on a Servlet container.
Download RESTeasy and unzip it you will see a lib/ directory that contains the
libraries needed by resteasy. Copy these into your /WEB-INF/lib directory. Place your JAX-RS
annotated class resources and providers within one or more jars within /WEB-INF/lib or your raw
class files within /WEB-INF/classes
Anish
Labels:
WebServices
Thursday, August 19, 2010
RESTfull webservices Overview
RESTfull webservice (Representational State Transfer)
Invented by : 2000 by Roy Fielding also known as e principal authors of the Hypertext Transfer Protocol (HTTP) specification
Concept: REST-style architectures consist of clients and servers. Clients initiate requests to servers; servers process requests and return appropriate responses. Requests and responses are built around the transfer of "representations" of "resources". A resource can be essentially any coherent and meaningful concept that may be addressed. A representation of a resource is typically a document that captures the current or intended state of a resource.
JSR Implementation: RESTEasy JAX-RS
Implementation
Invented by : 2000 by Roy Fielding also known as e principal authors of the Hypertext Transfer Protocol (HTTP) specification
Concept: REST-style architectures consist of clients and servers. Clients initiate requests to servers; servers process requests and return appropriate responses. Requests and responses are built around the transfer of "representations" of "resources". A resource can be essentially any coherent and meaningful concept that may be addressed. A representation of a resource is typically a document that captures the current or intended state of a resource.
| Resource | GET | PUT | POST | DELETE |
|---|---|---|---|---|
Collection URI, such as http://example.com/resources/ | List the URIs and perhaps other details of the collection's members. | Replace the entire collection with another collection. | Create a new entry in the collection. The new entry's URL is assigned automatically and is usually returned by the operation. | Delete the entire collection. |
Element URI, such as http://example.com/resources/142 | Retrieve a representation of the addressed member of the collection, expressed in an appropriate Internet media type. | Update the addressed member of the collection, or if it doesn't exist, create it. | Treat the addressed member as a collection in its own right and create a new entry in it. | Delete the addressed member of the collection. |
JSR Implementation: RESTEasy JAX-RS
Implementation
- Deployed as War file,
- Get the Rest easy war from the open source
- JAr's Required if Using JBOSS Rest Easy
RESTeasy is implemented as a Servlet and deployed within a WAR file.
- httpcore-4.0.1.jar
- javassist-3.6.0.GA.jar
- jaxrs-api-2.0.1.GA.jar
- jcip-annotations-1.0.jar
- jcl-over-slf4j-1.5.8.jar
- jsr250-api-1.0.jar
- resteasy-jaxrs-2.0.1.GA.jar
- scannotation-1.0.2.jar
- slf4j-api-1.5.8.jar
- slf4j-simple-1.5.8.jar
- activation-1.1.jar
- commons-codec-1.2.jar
- commons-httpclient-3.1.jar
- httpclient-4.0.ja
Other's java Implementation for REST full Web services are
Java Jt Design Pattern Framework, Wink , Restlet, JBoss RESTEasy, Jersey, Apache CXF, NetKernel, Apache Sling, Restfulie
Anish
Labels:
WebServices
RESTfull webservices Overview
RESTfull webservice (Representational State Transfer)
Invented by : 2000 by Roy Fielding also known as e principal authors of the Hypertext Transfer Protocol (HTTP) specification
Concept: REST-style architectures consist of clients and servers. Clients initiate requests to servers; servers process requests and return appropriate responses. Requests and responses are built around the transfer of "representations" of "resources". A resource can be essentially any coherent and meaningful concept that may be addressed. A representation of a resource is typically a document that captures the current or intended state of a resource.
JSR Implementation: RESTEasy JAX-RS
Implementation
Invented by : 2000 by Roy Fielding also known as e principal authors of the Hypertext Transfer Protocol (HTTP) specification
Concept: REST-style architectures consist of clients and servers. Clients initiate requests to servers; servers process requests and return appropriate responses. Requests and responses are built around the transfer of "representations" of "resources". A resource can be essentially any coherent and meaningful concept that may be addressed. A representation of a resource is typically a document that captures the current or intended state of a resource.
| Resource | GET | PUT | POST | DELETE |
|---|---|---|---|---|
Collection URI, such as http://example.com/resources/ | List the URIs and perhaps other details of the collection's members. | Replace the entire collection with another collection. | Create a new entry in the collection. The new entry's URL is assigned automatically and is usually returned by the operation. | Delete the entire collection. |
Element URI, such as http://example.com/resources/142 | Retrieve a representation of the addressed member of the collection, expressed in an appropriate Internet media type. | Update the addressed member of the collection, or if it doesn't exist, create it. | Treat the addressed member as a collection in its own right and create a new entry in it. | Delete the addressed member of the collection. |
JSR Implementation: RESTEasy JAX-RS
Implementation
- Deployed as War file,
- Get the Rest easy war from the open source
- JAr's Required if Using JBOSS Rest Easy
RESTeasy is implemented as a Servlet and deployed within a WAR file.
- httpcore-4.0.1.jar
- javassist-3.6.0.GA.jar
- jaxrs-api-2.0.1.GA.jar
- jcip-annotations-1.0.jar
- jcl-over-slf4j-1.5.8.jar
- jsr250-api-1.0.jar
- resteasy-jaxrs-2.0.1.GA.jar
- scannotation-1.0.2.jar
- slf4j-api-1.5.8.jar
- slf4j-simple-1.5.8.jar
- activation-1.1.jar
- commons-codec-1.2.jar
- commons-httpclient-3.1.jar
- httpclient-4.0.ja
Other's java Implementation for REST full Web services are
Java Jt Design Pattern Framework, Wink , Restlet, JBoss RESTEasy, Jersey, Apache CXF, NetKernel, Apache Sling, Restfulie
Anish
Labels:
WebServices
Friday, August 13, 2010
WebService with Annotaion Example using JBOSS
=============================================================================================================================================
CalculatorBean.java
=============================================================================================================================================
@Stateless
@WebService(endpointInterface = "org.jboss.tutorial.webservice.bean.Calculator")
public class CalculatorBean
{
public int add(int x, int y)
{
return x + y;
}
public int subtract(int x, int y)
{
return x - y;
}
}
=============================================================================================================================================
Calculator.java
=============================================================================================================================================
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
@WebService
@SOAPBinding(style = Style.RPC)
public interface Calculator extends Remote
{
@WebMethod
int add(int x, int y);
@WebMethod
int subtract(int x, int y);
}
=============================================================================================================================================
Client.java
=============================================================================================================================================
public class Client
{
public static void main(String[] args) throws Exception
{
URL url = new URL("http://localhost:8080/jboss-ejb3-tutorial-webservice/CalculatorBean?wsdl");
QName qname = new QName("http://bean.webservice.tutorial.jboss.org/", "CalculatorBeanService");
ServiceFactory factory = ServiceFactory.newInstance();
Service service = factory.createService(url, qname);
Calculator calculator = (Calculator) service.getPort(Calculator.class);
System.out.println("1 + 1 = " + calculator.add(1, 1));
System.out.println("1 - 1 = " + calculator.subtract(1, 1));
}
}
CalculatorBean.java
=============================================================================================================================================
@Stateless
@WebService(endpointInterface = "org.jboss.tutorial.webservice.bean.Calculator")
public class CalculatorBean
{
public int add(int x, int y)
{
return x + y;
}
public int subtract(int x, int y)
{
return x - y;
}
}
=============================================================================================================================================
Calculator.java
=============================================================================================================================================
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
@WebService
@SOAPBinding(style = Style.RPC)
public interface Calculator extends Remote
{
@WebMethod
int add(int x, int y);
@WebMethod
int subtract(int x, int y);
}
=============================================================================================================================================
Client.java
=============================================================================================================================================
public class Client
{
public static void main(String[] args) throws Exception
{
URL url = new URL("http://localhost:8080/jboss-ejb3-tutorial-webservice/CalculatorBean?wsdl");
QName qname = new QName("http://bean.webservice.tutorial.jboss.org/", "CalculatorBeanService");
ServiceFactory factory = ServiceFactory.newInstance();
Service service = factory.createService(url, qname);
Calculator calculator = (Calculator) service.getPort(Calculator.class);
System.out.println("1 + 1 = " + calculator.add(1, 1));
System.out.println("1 - 1 = " + calculator.subtract(1, 1));
}
}
Labels:
WebServices
Subscribe to:
Posts (Atom)