How to create restful web services on ejb 3.0? - rest

How to create restful web service on ejb 3.0. Can anyone share any tutorial about it?
I am using Netbean IDE 8 and Jboss 6.2.

Related

Tomcat restful web service database (JPA) with Netbeans does not work

I have been able to create Restful web services with JAX-RS for Tomcat. Using the Netbeans Restful web service from patterns wizard.
But I am not able to create Restfull web servicer from database with Netbeans wizard.
It miss some libraries. I add openJPA and Java EE web api 6 (over the added by the wizard). But it continues not working.
I added javaEE-TomEE 8.0 but did not work, either!
Does anybody know what have I to add to Tomcat to get JPA-Database Restful service working?
Moving to GlassFish is not an answer valid... I want to keep on Tomcat (adding the minimal)
I have made some advances...
With EclipseLink(JPA 2.0) I was able to connect MySQL in a desktop application...
Then I switched to Apache OpenJPA and I was no able to get an EntityManagerFactory...
So it seems I choose a library incomplete...
I imagine, in Tomcat, I have to choose other library than OpenJPA.

Access EJB from JAX-RS

While Developing a Java EE Web app, I would like to know simple ways to access an stateless EJB object through Rest.
This project needs no Dynamic Web from Java, as Client side is fully javascript deployed, so communication is done only with Ajax calls.
As I've read one way would be to create 2 EJB one for functionality other to represent Web Service.
Is there a way to avoid the Web Service part? (avoid completely the WAR) Maybe with DI?
Java EE 6, EJB 3.1, Eclipse desired. I also believe the right application server would be Glassfish instead of Jboss, due to it's compatibility with EJB 3.0
No interesting in using JAX-WS
With EJB 3.1 you can actually publish a session bean as a JAX-RS web service, if you package your (properly annotated) session bean inside a WAR.
So, the simplest solution I can think of would be to create a WAR (a dynamic web app if you're using Eclipse) and create a JAX-RS annotated stateless session bean inside the web app. You don't need any EJB projects at all.
Not really. In Java EE 6 you can directly publish a Session Bean as a JAX-WS web service, but not as a JAX-RS web service. You're pretty much stuck with creating a WAR that hosts that JAX-RS services that front the EJBs themselves.

Applet Web service client, with Eclipse Indigo using Apache CXF,

I'm trying to consume a web service within an applet.
For that objective i've tried Apache and Apache2, both with good results
but the problem is that the jar dependencies are far too fat for my application
(the jar for axis or axis2 are over 1.5MB, and the applet is less than 200KB)
So i will try consuming the web service with Apache CXF, hoping that the jars
are at least a bit smaller.
Using eclipse one creates an empty project and in the main classes implements
the applet and blah blah, but to create the web service one must use the web service
wizard.
I've used this wizard before, to consume the web service using Axis, but the moment i choose other options i get this message:
****The Apache CXF 2.x Web service runtime in Tomcat v7.0 Server does not support the client project****
What i´m missing?
I've already installed, CXF 2.x runtime, and the Tomcat 7 Server, and of course the Eclipse Web Tools.
This question How to generate web service client with Apache CXF in Eclipse Helios?
shows a very hard solution and it´s one year old!
is there any other way to consume webservices within an applet?
ksoap2 has no documentation on complex webservices, and ksoap2-android
neither
Sorry for a boring question, but any help is greatly apreciated
Apache CXF 2-x Web service runtime Tomcat Server not support client
The Apache CXF 2.x Web service runtime in Tomcat v7.0 Server does not support the client project
Answer: If you see above error during creating web service client in eclipse using Apache CXF means you are using java project to generate the client from WSDL. Latest version of JAX-WS supports Dynamic Web Module v2.5 and up. So create client using apache CXF first you need to create Dynamic web project.
Once dynamic project created then open web service client wizard to create client from WSDL and issue should be resolved.

How to add resteasy-guice apis to jboss

I am trying to use GUICE with resteasy as mentioned here
But the JBOSS does not have this resteasy-guice-2.2.1.GA.jar in lib. So I would like to know how to integrate this lib with jboss.
I am using jboss 7.0.

EJB 3.0 webservice in weblogic 10.3.3.4

I am trying to create a EJB 3.0 session bean with methods exposed as webservice.I am using Eclipse and my weblogic server is integreated and is there a tutorial of sorts to create a sample webservice?
Have you seen the docs that have an example of an EJB 3.0 web service?
http://download.oracle.com/docs/cd/E21764_01/web.1111/e13758/jws.htm#i246190