I've come from a C#.NET development, have developed and implemented RESTful services in Visual Studio with WCF hosted on IIS, but now I need guidance on one of my project requirement, to develop RESTful service with GlassFish Server Open Source Edition 4.0 (not Oracle GlassFish), found here:
https://glassfish.java.net/download.html
I have no idea about Java and GlassFish, so if any tutorial post or video provided will be highly appreciated. What all sorts of application software do I need to install and what will be the development environment? I mean every step involved in the process of developing in GlassFish.
Also is there any way to develop RESTful service in C#.net and deploy on GlassFish 4?
I've done REST web service with C# and with Java and, basically, both technologies are quite similar. I would recommend you to spend some time learning the servlets, understanding then and with your knowledge of web services you will find no problems to implement your service.
Additionally, yopu could also take a look to the Java technologies specifically implemented for REST like "JAX-RS: Java API for RESTful Web Services" (https://en.wikipedia.org/wiki/Java_API_for_RESTful_Web_Services). This may help you, but I would begin with the basics of a servlet and the servlet container (GlassFish).
Related
I'm going to start developing a new simple "X management" kind app, like contact management or events management. What I want to know is which tools would be the best to achieve it in the way I want.
My app needs to be a web app running on a server that has a mysql database to save and retrieve some simple information. This app must have a web client but I want it to be able to be extended to work with an Android app client.
Things I've thought:
I've worked on Java with facelets and JPA travels management app running on a GlassFish server on localhost with a JSF web view, so maybe my web client and the full app could be done with this.
I've worked with web services such as SOAP and REST with Jaxb and xml schemes to retrieve information parsing some webs into xml or json to show on a client .net app. So I've thought I can add to my app, like last topic we talked about, a REST web service layer to easily work as I want, or at least I think it would be easy. If I do this the Android app could share the same app core code but using the REST service.
My question is what could be the best way to do an app with 2 client side in different platforms that could share some code to be easy to extend it moreover to a desktop app. I've talked about these 2 options because I'm a students of computers at university and those are the tools I know, but I can easy learn more. I've also think about just a REST service and create a web and an Android client to work on same service or something like that.
This post is getting long, so here is the summary: What technologies and tools do you think are the best choice to create an java web app that needs to have web and Android client? Also what server, like tomcat, GlassFish or another, should I use? And what about persistence layer? JPA with mysql is the best I know to work with.
Thanks a lot.
P.D: I work with eclipse
From my point of view:
You can use java jersey and java spring both ( java spring as Dependency injection) for creating RESTful Web service. So, In server side you will create endpoint and you can access data from any platform through those endpoint.
Server can be anyone. It's up to you. I always try to use tomcat but tomcat is not a full JavaEE container it's only a servlet container. So if you want to use full JavaEE version then you should use Glassfish.
And yes JPA .It can be easily used in any environment supporting JPA including Java SE applications, Java EE application servers, Enterprise OSGi containers etc.
On the other hand, still choice is yours.
I'd like to build a Java Web Service using JAX-WS and GlassFish 3. All of the guides showing the basics of Web Services in Java using tools like wsgen and wsimport to generate a lot of the boilerplate code to implement the Web Service. Is this just how it is done or does anyone know of some resources that go into more of the details?
IF you want to learn from the very beginning:
Heavyweight Web Services (SOAP/RPC) with JAX-WS
SOAP Contract (WSDL) and the Contract-first vs Code-First debate
Lightweight Web Services (RestFul) with JAX-RS
RESTFul Contract (WADL)
Web Service Deployment (Frameworks + JAX-* deployed in some App Servers)
Web Service Clients (i.e. usage of wsimport)
Introduction to Web Service Security, Addressing, etc
I recommend you Java Web Services. Up and Running by Martin Kalin. After that, if you need to go further with one of these subjects, I suggest you to get any of the 'cookbooks' published by O'Reilly.
Good starter point is Official Java EE Tutorial.
I want to utilise the Facebook JavaScript API in the client, but manage app logic and configuration on the server through REST web services. I've tried a lot of tutorials out there, but so far I haven't seen one that actually works.
What do you recommend as a server / web framework?
What technology should I use for my REST endpoints?
How can I host this application in a place where facebook will "see" it as a valid app?
I'm looking for a comprehensive tutorial or set of recommended practices to get started.
Thanks
I just so happened to create a blog series that takes you through EVERYTHING you will need. The articles:
Setup Eclipse (IDE) and JBoss AS7 (server)
Setup other JBoss Tools including Forge
Setup JAX-RS Web Service in Java using Forge (very easy!)
Setup account to Host the site for FREE with OpenShift
Setup an entire sample Facebook App
This blog series should be EXACTLY what you're looking for. You can find the first of three articles here:
http://ocpsoft.org/opensource/creating-a-facebook-app-setup-and-tool-installation/
I would recommend going with Spring Social module with has a good abstraction of the Facebook API.
You could then expose these services via REST with Spring Web Services or Jersey.
I am not sure about the hosting. Facebook should see it as a valid application no matter the host. Even your development computer/localhost cando it.
I am working on an enterprise application and need to provide services to mobile app using REST.
I want to implement or build a REST API for my website using which I can build client side application as well as provide services to the mobile app for my website.
I have very less idea about it and for technical specification.
My website uses Spring Framework and is build upon Java.
Kindly guide me through.
You can find some resources here about developing REST applications with Spring MVC
http://blog.springsource.com/2009/03/08/rest-in-spring-3-mvc/
http://static.springsource.org/spring/docs/3.0.0.M3/spring-framework-reference/html/ch18s02.html
http://www.oudmaijer.com/2010/01/16/spring-3-0-rest-services-with-spring-mvc/
and a general tutorial about REST:
https://www.ibm.com/developerworks/webservices/library/ws-restful/
Hi guys is there a way to self-host a web service in Java just like WCF?
Jersey using Grizzly embedded within it would seem like a good fit for your needs. It wouldn't require and outside application server and would be fairly lightweight to get setup. You can just read the Jersey getting started documents to get going with that exact path:
Jersey User Guide
If by self-hosting you mean generating a web service endpoint for invocation, there are a number of ways to go on this, depending on your potential deployment environment.
I'd start off looking at Oracle's JAX-WS implementation, which includes RESTful capabilities. If you want to run a relatively simple stack, you could use Apache Axis2. And then JBoss has JBossWS, which can run standalone or in the JBoss Application Server. I'm pretty sure most of the major application server engines have a Web Services component as well.