Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I want to learn Java WebServices. I read couple of articles on IBM developer works but I think I am getting confused about where to start. My main interest is Restful webservices. Where can i start from? I also prefer book with web service development example based on eclipse platform.
I always find very useful response from this site and always respect the people who responds to all these questions, so as always this time too I am expecting top answers.
Thanks a lot
The Spring Framework has great support for RESTful web services in java. It is a huge library for web development in Java so it might be a bit heavy handed. However, in my experience you eventually end up needing a lot of what's provided by Spring whether you plan on it or not.
http://static.springsource.org/spring/docs/current/reference/mvc.html
So with Spring Web MVC, you can create web controllers that handle requests in a really clean way, something to the effect of (but not tested for exact correctness):
#Controller
public class PetController {
#RequestMapping("/pets/{petId}")
public void findPet(#PathVariable String petId) {
// implementation omitted
}
}
In terms of learning about RESTful web service design, I'd suggest RESTful Web Services by Richardson, Ruby, DHH.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I want to develop a Web application in which front end will be developed in HTML, C#, ASP.net and server side will be using JAVA ( JAX-RS jersey ).
So, the front end will be running on IIS server and java will be running on Tomcat server.
How to consume Java REST API from C#?
I mean is there any way to to communicate between two different servers ?
Note: This is my second time asking question on this platform, so I am sorry if my question doesn't make any sense.
Perhaps you can look into using the Spring framework. With the Spring framework, you can build a RESTful web service that has end-points with which your front-end can communicate. It works like the C# Web-Api, in that you can define a "base URL" and other specific URLs that you can link to a function in your Java code.
Spring website:
https://spring.io/
Some help to getting started:
http://www.journaldev.com/2552/spring-rest-example-tutorial-spring-restful-web-services
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm vey new to developing in Spring.
I want to develop a project, but I don't know how to structure it.
I want to develop an application that I can use on the web and on mobile.
A app eqaul to mine idea would be this stackoverflow website.
I want everything to be visible on the web, but i want to develop a mobile application that can accces/edit the data.
I hope someone can give me a idea.
Thanks in advance!
This is not really a Spring question.
What you want is a REST API and two clients : a webapp and a mobile app (or just a responsive webapp which fits on mobile devices).
The REST API as well as the clients could be written with any framework. I don't know if Spring has mobile built-in features.
EDIT
You can have 2 controllers within the same webapp : one controller serving request at URI /rest/... for example and another controller serving JSPs for the web.
Or even as you stated a single controller which return HTML (via JSP) or JSON depending on the request.
Have a look at http://spring.io/blog/2013/05/11/content-negotiation-using-spring-mvc (old link, there might be a newer up to date link..)
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have to create a RESTful web service. But, I was thinking for a generic RESTful web service for SOA. I don't know is it a good or bad idea for RESTful SOA.
How can I create generic web service which also satisfying REST concept.
Quite an endeavour.
At a first thought you would have to provide some kind of abstraction layer over the resources that you would typically expose. And that's just the API. Then you would have to execute custom logic for every resource you access.
The short answer is that it's not worth trying to figure out. Going with the typical solutions we have now is far better than over-generalising REST.
There is no one-size-fits-all.
I totally agree with #Gabriel Ruiu - "There is no one-size-fits-all."
But if you are thinking about building an API kind of thing (maybe a library) using which one could build RESTful Services easily, then you can generalize some of things and expose the features via your API.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I usually write my web services using PHP + Mysql, in a simplified way: reading the POST/GET params, connecting to the MySQL database and finally printing a JSON.
I'd like to check how to do this with a Java server, I've never programmed Java web servers and I'd like to know what should I study to learn to do it
Thanks
I'm supposing here that you have a good understand of java programming.
Fisrtly, I think you should understand java for web.
I recommend this book:
Head First Servlets and JSP
http://www.amazon.com/Head-First-Servlets-JSP-Certified/dp/0596516681/
Then you can learn web services with java:
Java Web Services: Up and Running
http://www.amazon.com/Java-Web-Services-Up-Running/dp/1449365116
Of course, there are many tutorials over the internet as well, but books give you a lot of background information.
I wanna suggest you garner understanding of the two main WebServices Architectures then decide which ones suit your case/use best
REST (GET,PUT,POST,DELETE,PATCH) JAX-RS
http://docs.oracle.com/javaee/6/tutorial/doc/giepu.html
vs SOAP bases JAX-WS
http://docs.oracle.com/javaee/5/tutorial/doc/bnayn.html
Comparing them:
Main differences between SOAP and RESTful web services in java
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I'm developing a web service and as being new to the technology, I did a bit of research on the internet on the infrastructure software/technologies needed. Below are my findings and hope to get your precious opinion:
Application Server - Tomcat6
Web service engine - Axis2
Web service implementation - POJO
Accessing Database MySql - JPA (Only 5 simple tables)
Do they look good to you?
I'm thinking of using EJB3 for point3, but there are a lot of people on the internet (and this forum) saying EJB3 is not worth the effort, POJO will do. What's your view?
Thanks,
Sarah
Might be worth trying on programmers.stackexchange.com as its not specifically a coding question. For my 2 cents, I'd seriously consider whether you wanted to go down the SOAP route (Axis is SOAP only) or whether you should use REST.
Tomcat is usually a good choice for a server, as is MySQL for a DB. If you're going to use JPA, you need to choose a JPA implementation; the obvious one is Hibernate. If you do choose to use REST then I can recommend Jersey, which is Sun's reference implementation.