Posts

Showing posts with the label web services

Install Tomcat with Eclipse

Image
Howto install Tomcat with Eclipse IDE on MacOS X. What we need: Tomcat Eclipse JEE 1. Extract Eclipse into your Applicationfolder and Tomcat to your prefered location for example into your home directory. 2. change into the apache-tomcat-6.0.20/bin directory and make all .sh files executeable cd <pathtoyourtomcat>/apache-tomcat-6.0.20/bin chmod +x *.sh 3. test if it starts ./setclasspath.sh ./startup.sh something like this should appear: ./startup.sh Using CATALINA_BASE:   apache-tomcat-6.0.20 Using CATALINA_HOME:   apache-tomcat-6.0.20 Using CATALINA_TMPDIR: apache-tomcat-6.0.20/temp Using JRE_HOME:       /System/Library/Frameworks/JavaVM.framework/Home 4. Test you tomcat installation via your Browser http://localhost:8080/ if everything works like expected shut the tomcat instance down ./shutdown.sh 5. Now we add Tomcat to our Eclipse environment Double click on the server an...

Jersey REST The ResourceConfig instance does not contain any root resource classes

I had the same error message and solved it by modifying my web.xml file. Make sure it has this in it: <init-param> <param-name>com.sun.jersey.config.property.packages</param-name> <param-value>your.package.name.here</param-value> </init-param>

JAX-WS Deployment Five Minute Tutorial

After we explained how we can implement a JAX-WS web service (endpoint, client) in the JAX-WS Five Minute Tutorial , we will continue by explaining how we can deploy the web service endpoint on any application server... and here we'll use Tomcat. To deploy your WS endpoint you need to package it as a war first then deploy it on your application server. Note:- You can download the source code for this example from the resources section. Ok, lets begin  1) Open Eclipse. 2) Create a new Web project . 3) Create your Web Service interface (Greeting): package com.webservices; import javax.jws.WebMethod; import javax.jws.WebService; @WebService public interface Greeting { @WebMethod String sayHello(String name); } 4) Create your Web Service implementation (GreetingImpl): package com.webservices; import javax.jws.WebService; @WebService(endpointInterface = "com.webservices.Greeting") public class GreetingImpl implements Greeting { @Override public...

JAX-WS Five Minute Tutorial

This tutorial is for people who want to run a JAX-WS example (Endpoint + Client) in just five minutes. What you need to run this example: JDK 1.6 Eclipse . Be Excited ;)  Note:- You can download the source code for this example from the resources section.  Developing WebService End Point 1) Open Eclipse, and create a java project "WS-Server". 2) Create WS-Service Endpoint Interface: package com.webservices ; import javax.jws.WebMethod; import javax.jws.WebService; @WebService public interface Greeting { @WebMethod String sayHello(String na...

Web service with JAX-WS in Eclipse

Image
In this tutorial, I'll show you how to use JAX-WS to build a web service in Eclipse. JAX-WS stands for Java API for XML Web Services. You can use it to build web services and clients that communicate using XML messages. We are not using the built-in web service generation tool provided by Eclipse. How to build a sample client will be explained in a future blog post. The basic steps for building a web service: Code the implementation class Annotate the class Use wsgen to generate web service artifacts Deploy in Glassfish from Eclipse 1. Code the implementation class First create a dynamic web project in Eclipse. I called my project webservice , but you call your project anything you like. Make sure the target runtime is Glassfish, and select Minimal Configuration in the configuration screen. In the next screen, accept the default output folder or choose a custom one. Memorize the output folder, because we need this when we generate the web service artifact...