How to implement web services in java - java

I'm actually working on a website project. I'm new with web services. I have 4 years experience in object oriented programming (java, c#, ...). I have read a lot on web services but none of my documentations are telling how to use all the technologies to make a real web service project.
What I want to do is:
1. Use a MySQL backend mapped with JPA in Java;
2. Use web services to present some functionalities with ... (JBoss, ... there is to much possibilities, I do not know which I should choose)
3. Create a dynamic web project (maybe in Jsp to keep the Java perspective) to present web service data to the end-user with HTML, Javascript, jQuery, ...
If you can help me with documentations, links or real project implementation samples, it will be greatly appriciated.
Thanks

Check this. for beginner
I would suggest go for Spring Web Services from your env. It would be better

I have found something interesting using spring web services with eclipse that I will use with my project at this link:
Sprint Web service tutorial with Eclipse

Likewise, here's a NetBeans tutorial: Getting Started with JAX-WS Web Services

Related

Can you implement Vue.js in a Java EE web application?

I just develop a tool with my classmates and we want to use Vue.js as Web interface.
For Description what we programmed. We developed a Java EE web application in Eclipse. We use Tomcat 7 as web server. I search a long time and i found nothing.
Vue.js is a javascript front-end framework. There is nothing to stop you from using that with a middle-layer/back-end technology like Java EE.
In your HTML pages(or JSP) just include the Vue.js file as mentioned in the documentation, and other .js files that you create as part of your vue.js frontend application.
The library can then interface with any HTTP-based backend methods that you expose (using Servlets, Controllers, etc.) depending on how your Java EE project is structured and what frameworks it uses.
While investigating the same question, I found this good blog that has a git repository too
https://blog.codecentric.de/en/2018/04/spring-boot-vuejs/
From a glance it looks like a read solid implementation, however it has some sticky setup i haven't come across before.
It dose however seem like a professional and scalable solution i will definitely
give a try.
https://github.com/jonashackt/spring-boot-vuejs
Thankyou 04/24/18 by Jonas Hecht
For sure you can.
Your java application, which is your "backend", has to expose its functionalities as Web services (REST Json WS should be the easiest for what you are trying to do).
To expose your services as Web services, you need to find the easiest framework fitting your need. You will probably need to dive into Maven if you haven't yet, because these frameworks tend to have tons of dependencies.
Your Vue.js interface will make calls to the backend via HTTP requests each time necessary (get a resource, update a resource, ...).

Creating a web application with java

I have been trying for the past week or so to wrap my head around how I would go about creating a web application using java. I have looked into many services such as Vaadin, GWT, and CUBA, but because I don't really know which I need I haven't had much luck. Here is what I need:
Web application framework in java (I don't know HTML or Javascript)
Ability to use polymer elements
I would also prefer a minimized use of XML files, but I could work with them if need be.
The Java framework for web development is J2EE. It provides a Web Container to run web application (.war file) as well as other stuff.
Web application can be servlet, JSP etc.
If you are not familiar with Java Web Application, you may want to start with using Eclipse. The following video shows how to use eclipse to build a project for web application
https://www.youtube.com/watch?v=Av6zh817QEc
Since one criteria is to use Polymer I recommend having a look at
gwtmaterialdesign
there are already a few tutorials how to get started and also ready to use templates.
Anyway I believe that you've to dig a little into GWT ...

RESTful Web service in Java desktop application

I'm currently working on a Java desktop application project. It's an existing application and I was asked to modify it.
They say that I have to send data from the desktop application to a web application using RESTful web service. So I search a bit about RESTful web service (cause I'm new with that kind of stuff and I'm also new with Java), and I saw some non-web applications that used RESTful web service but the non-web applications are Maven project. And the existing java desktop app that I need to modify is not a maven project.
So I was wondering if it's possible to use RESTful web service in java desktop app that is not a maven project?
Sorry for this question but I hope someone can help me. Please. Newbie here. Thank you in advance.
I recommed you to use the Jersey library. I have only good experiences with it and I used it a lot in servlet projects. If you do not use Maven, then simply download the .jar file here and copy it into your project. You also have to add it to your classpath.
If you want to know, how to implement simple REST clients with it, there is plenty of material out there, like here.

Building my first Java Web Application

I have to build a java web application and I'm not sure where to start.
I have a good amount of experience with java but I would like to know if anybody can point me to a good example of how to integrate java into a web page?
I searched google without much luck. Is there a decent example on how to do this? Is it similar to adding a flash object with an object tag? Thanks
You can start creating sample web application based on html and servlets, This site will guide you in doing so.
http://www.servletworld.com/servlet-tutorials/simple-servlet-example.html
You will need
JDK
Apache Tomcat(jars will be in tomcat so no need to download separatly)
There's an app for that.
http://www.appfuse.org
AppFuse is an open source project and application that uses open source tools built on the Java platform to help you develop Web applications quickly and efficiently. It was originally developed to eliminate the ramp-up time found when building new web applications for customers. At its core, AppFuse is a project skeleton, similar to the one that's created by your IDE when you click through a wizard to create a new web project.
You ahould start searching about :
Servlets (and Apache Tomcat)
JSP
Java Faces (and Apache MyFaces)
Existing web frameworks
I think the easiest is to download Netbeans for Java EE with Glassfish, install it and use a wizard to create your first Hello World web application.
Then I recommend learning Spring MVC - I think it is the easiest to start with and very flexible so you can add more and more functionalities later. For templating, I recommend FreeMarker or Velocity.

Web Services in Java, beginner question

Im new to the subject of web services in java, though im familiar with the concept of web services. As im new to this topic,i have the following questions which i would like someone to help me with.
1) How are web services created in Java ?.Ive come across methods like using Eclipe WTP (Web Tools Platform), Sun WSDP (Web Services Developer Pack). What is the difference between them and which one to use ?
2) Is there any particular book or article on the web which i can refer to for learning how to create a basic web service using Java ?
3) If i have a WSDL file, is there any way i can test it ?
Thank You
1) Actually you have a lot of choices. See this question for a discussion about Java Web Services Frameworks. The two methods actually use a different framework, Eclipse uses Axis2.
2) Most, if not all, frameworks support 'contract first' development (from an existing WSDL), both for services and clients. For testing, SoapUI may also suit your needs.
Before choosing any tool and technology, first understand what webservice technology is about and what benefits it offers.
Its always better to understand the proper semantics of xml, xsd and other concepts(including namespaces).
Then pickup a book/article that explains how to implements one in java.
Choose a framework (Apache Axis, Spring ws etc) and implement one.
There are lot of resources available online that help you in your learning path.
Happy webservices.
For #3, you can test it using the web services explorer in Eclipse. Its really nice actually. Copy the source for the WSDL and copy it into some file in your project (xxxx.wsdl). Then, right click on that file in the navigator and choose "Web Services" -> "Test with Web Services Explorer"
If you dont have this option, then you need to install the necessary plugins into Eclipse to do this (or I think if you install the EE version of Eclipse it already has this). I dont recall which plugin I installed that added this functionality, but it was something relating to web work.
Once you've opened this, you can input values as the wsdl specifies and view the source xml as needed.
I'm also new to web development and I've found this incredibly helpful.
Best of luck!

Categories

Resources