Hibernate RESTful webservices in NetBeans - web-services

Is it possible to create RESTful Web Service using Hibernate in Netbeans 7.4?
I could see wizard to create RESTful Web Service using Persistence, but would like to know how it can be integrated with Hibernate?
Appreciate any help or insight.
Edit 1
I would like to know what I did is the correct method of generating RESTful web services using Hibernate.
First I generated Hibernate Entity classes using NetBeans and then I created RESTful services from Entity classes. So does this creates RESTful Web Services with Hibernate? I could see AbstractFacade classes that is almost like DAO classes
Edit 2
Screen shot for selecting RESTful Web Service from Entity classes

If you want to build a truly RESTful service, you need to build up a link relation architecture. You're going to need more than Hibernate or Netbeans to do that.
I recommend using the milestone Spring Data REST in conjunction with Hibernate's JPA implementation and Spring HATEOAS. See Spring Restbucks as an example which brings all these technologies together.

Related

When to use javax.ws.rs.core.Application to create RESTful web services?

I have developed RESTful web services in two ways:
used a class that extends javax.ws.rs.core.Application without defining a web.xml file, using Glassfish.
haven't used javax.ws.rs.core.Application but included a web.xml and a Jersey implementation, using Tomcat.
Is there a preferred way of building RESTful web services with JAX-RS?
Using the javax.ws.rs.core.Application class is the preferred way and also the only portable way of configuring resources and providers in a JAX-RS web service,
so if possible that would be the recommended way to set it up.
But that works well only in JAX-RS aware servlet containers or application servers, for JAX-RS non aware servers you need other ways for deployment and that most of the times means some proprietary servlet class of the JAX-RS implementation you are using.
To get more details on the subject, see for example the Jersey documentation, Deploying a RESTful Web Service (for Jersey v1.x) and Application Deployment and Runtime Environments (for Jersey v2.x).

Strategy to develop a web service in JAX WS

i'd like your help to designing a wb serice but I don't know how i can't do this.
In fact my application handles data management clients. My application is developped in struts 1.0, spring, weblogic and build-in maven.
He was asked to me to make an evolution because an external application need to access data such as displaying the address of the client or displaying data bank. For this, it was planned to create a web service to retrieve in real time.
I would like to know the strategy to use for designing a web service. Do I need to create a new Dynamite projet maven + JAX WS to my web service and deploy my war on my weblogic server?
Or they have something else to do ?
Thanks a lot !
I am not sure that this question is related to maven.
Adding a WebService (or RestService) could be quite easy with springframework and apache cxf (http://cxf.apache.org/)
see jaxws or jaxrs for more.
create web service in a two types but real time applications using jax-ws web services reason for consumer want to send data into provider.consumer can know the entire information about the provider by seeing its WSDL Document.

Webservices for Spring 2.5.5

I have web application designed using spring 2.5.5 MVC, JBoss server. I want to expose my spring services (like add/update User, comments, documents, etc.) using WebService for EAI. Requirement is like any third-party application should be able to perform operations in my web application after authentication/authorization.
I have novice knowledge of SOAP (Axis2) and REST (Jersey), however i am not sure which will be best suited for my application.
Cheers
We are using Spring 3.0 actually. But former using Axis2 with Spring 2.5.x.
You might review our stack at http://incubator.apache.org/openmeetings the axis.
We simply integrated the regular Axis2 configuration into the web.xml and build a Facade to load the spring beans into the Axis enables Web-Service and forward the calls to the Spring enabled context that way.
Comparable to https://svn.apache.org/repos/asf/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/axis/services/FileWebServiceFacade.java
It is not the perfect solution, the Axis2 documentation also contains other ways to load the Spring context in the Web-Service enabled class, however it was never possible to make that work stable so we decided for this workaround.

spring web controller use as web service

Currently I use Spring mvc to develop my we application. In future there will be a requirement to develop mobile app for this application.
In asp.net c# MVC have ability to use there web controller class as the web service. Then mobile app can use that controller class as web service.
I want to know is there an ability to use Spring MVC controllers as a we service. If yes, then how. Please explain.
You can easily write a Restful webservice using Spring MVC. The controller classes can return XML/JSON as required. It is simply a case of configuring an appropriate ViewResolver in this case a ContentNegotiationViewResolver.
This is an excellent guide which will walk you through the basics of Spring MVC as a webservice.

Approaches for creating REST Web services?

i am new to REST Service development. I compared the development mechanism for both REST and WS web services and i found that you can create a WS web service using WSDL file that is the top down appraoch (Correct me if i am wrong) and using bottom up approach also, that is generating the classes manually.
But when it comes to REST web service development you have to follow bottom up approach only that is generating the classes manually. NetBeans IDE provides certain wizards for creating REST web service quickly from databases, entity classes and patterns.
I had also seen when you are developing web service in eclipse and you are using wizard in eclipse IDE, you can create a REST web service from WSDL file. I found this very strange. My question here is what are the approaches we can have for creating REST web services. Can we create REST web services using top-down and bottom up approached. If yes then please provide me details.
Thanks.
It is possible to describe a REST service using a contract. This is the intent of WADL and WSDL 2.0. WADL is specifically a REST contract, whereas WSDL 2.0 evolved from the original WSDL spec. to support all HTTP bindings. Since REST services rely on the use of HTTP methods and headers to exchange messages a WSDL 2.0 contract can work. There is a really good explanation here: http://ajaxonomy.com/2008/xml/web-services-part-2-wsdl-and-wadl
For development of REST services, I'm not sure if NetBeans, Eclipse or other tools specifically support automated REST service from WSDL generation. I would imagine that most are still intended for SOAP service creation. At this point I think WSDL 2.0 and WADL can be used to describe a REST service, but are not intended for automated generation of a REST service.
REST services are simple HTTP request/response,and therefore don't require complex stubs. In most cases it would probably take more time to write the WSDL describing the REST service, than it would take to write the REST service itself.