EJB 3 | Entities with webservices - web-services

I want to access a inventory system which is accessible through webservice, What is the best way to integrate, I thought of directly expose the entity facade as a web service using #WebSerive it's possible but don't know whether it's a good approach or not, need some advice.
Thanks.

You could eventually define the methods to be exposed in the same class (or maybe create a wrapper).

My understanding is that you want to consume a web service i.e. to implement a web service client. My recommendation would be to use JAX-WS for this. See :
A Simple JAX-WS Client in the Java EE 5 Tutorial
Developing JAX-WS Web Service Clients

Related

Hibernate RESTful webservices in NetBeans

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.

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.

Axis2 vs JAX-WS

I have to implement SOAP based web services for a project. We are considering different options like axis2, ejb as a web service, jax-ws but not really sure about the advantages/drawbacks of these options. Can someone please help in this regard.
It would be great if someone can point to any other alternatives for implementing SOAP based webservices.
Thanks in advance,
-Csn
For me, the easiest way to expose a web service is creating an EJB with annotations (JAX-WS) if you are using a Java EE server like JBoss.
Consuming a WS is a bit different but I prefer JAX-WS too, because Axis2 throw exceptions if you use complex parameters (classes) and you add an attribute. JAX-WS instead calls every 'get' and 'set' for the serialized xml. If no 'set' is implemented, no problem.
That's an advantage for backward compatibility.
I would highly recommend to use Apache CXF for developing SOAP web services. This stack is based on JAX-WS but has much more features. CXF has an excellent integration with Spring. There are a lot of documentation on the internet how to create web services using this framework. If I would be working on completely new web service I would definitely choose Apache CXF.

What is the easiest and most simple way of creating webservice (SOAP) using Spring?

i am not familiar with the most optimal and easy way on how to develop webservices using Spring. We are going to use Tomcat as our application container, so i was wondering what the most easy way would be to develop webservices using Spring running on Tomcat? Should i use CXF/Axis or something else? We are planning to use the code-first approach.
Currently we already have some nice Spring beans as services and it would be great if we could expose them as SOAP endpoints.
If you use code first, I would suggest Apache CXF with the jax-ws front end or the simple front end
The JAX-WS version is more powerful, but the Simple Frontend decouples your code from the framework (you don't need to annotate your services). Both are simple to create and work reliably.

Java WebService (Rest/SOAP) Design Pattern

We have an application built using Springs/Hibernate/Springs-MVC/.
Now we want to provide RESTful services, planning to use Springs MVC. My question is, is it better to expose the service API directly as Rest Service or write a new Pojo Layer on top of the Service Layer and expose that ?
Will appreciate your insights. Thanks.
I am pretty sure you would want to have a top layer so you can only expose what you want to expose from your Web Service to the outside.