how to write client for below provider...in Restfull ...(I want to access xml format of service result to client)
<p>service provider,2.web.xml 3.pojo class.. 
how to write client for below provider...am getting output at provider side  in the form of xml from database so i want it in client side,how to write client in rest?</p>

<pre><code>    package sample.first;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;

@Path("resttest")
public class airtime {
    static ResultSet rs = null;
    static String msg = "hello";
    static Connection dbConnection = null;
    Statement st;

    @GET
    @Path("get_users")
    @Produces("application/xml")
    // Method for getting iduser
    public List&lt;userData&gt; get_users() {
        List&lt;userData&gt; retUser = new ArrayList&lt;userData&gt;();
        try {
            dbConnection = JDBCConnection.getDBConnection();
            st = dbConnection.createStatement();
            rs = st.executeQuery("SELECT iduser FROM user11");
            System.out.println(rs);

            ResultSetMetaData rsmd = rs.getMetaData();
            while (rs.next()) {
                System.out.println("entered while loop");
                int numColumns = rsmd.getColumnCount();
                userData toReturn = new userData();

                for (int i = 1; i &lt; numColumns + 1; i++) {
                    System.out.println("entered for loop");
                    System.out.println(numColumns);
                    String column_name = rsmd.getColumnName(i);
                    System.out.println("column name: " + column_name);
                    int id = rs.getInt("iduser");

                    System.out.println("id=" + id);

                    if (rsmd.getColumnType(i) == java.sql.Types.INTEGER) {
                        System.out.println("Integer working");
                        toReturn.iduser = rs.getInt(column_name);

                    }

                    else if (rsmd.getColumnType(i) == java.sql.Types.VARCHAR) {
                        System.out.println("Varchar working");

                        toReturn.name = rs.getString(column_name);
                    }

                }

                retUser.add(toReturn);
            }
            dbConnection.close();
            return retUser;
        } catch (Exception e) {

            System.out.println(e);
        }
        return retUser;
    }

    @GET
    @Path("get_all")
    @Produces("application/xml")
    // method for getting iduser and name(Multiple columns)
    public List&lt;userData&gt; get_All() {
        List&lt;userData&gt; retUser = new ArrayList&lt;userData&gt;();
        try {
            dbConnection = JDBCConnection.getDBConnection();
            st = dbConnection.createStatement();
            rs = st.executeQuery("SELECT iduser,name FROM user11");
            System.out.println(rs);

            ResultSetMetaData rsmd = rs.getMetaData();
            while (rs.next()) {
                System.out.println("entered while loop");
                int numColumns = rsmd.getColumnCount();
                userData toReturn = new userData();

                for (int i = 1; i &lt; numColumns + 1; i++) {
                    System.out.println("entered for loop");
                    System.out.println(numColumns);
                    String column_name = rsmd.getColumnName(i);
                    System.out.println("column name: " + column_name);

                    if (rsmd.getColumnType(i) == java.sql.Types.INTEGER) {
                        System.out.println("Integer working");
                        toReturn.iduser = rs.getInt(column_name);

                    }

                    else if (rsmd.getColumnType(i) == java.sql.Types.VARCHAR) {
                        System.out.println("Varchar working");

                        toReturn.name = rs.getString(column_name);
                    }

                }

                retUser.add(toReturn);

            }
            dbConnection.close();
            return retUser;
        } catch (Exception e) {
            System.out.println(e);
        }
        return retUser;

    }
}





&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    id="WebApp_ID" version="3.0"&gt;
    &lt;display-name&gt;Restdyamicnew&lt;/display-name&gt;
    &lt;servlet&gt;
        &lt;servlet-name&gt;Jersey REST Service&lt;/servlet-name&gt;
        &lt;servlet-class&gt;com.sun.jersey.spi.container.servlet.ServletContainer&lt;/servlet-class&gt;
        &lt;init-param&gt;
            &lt;param-name&gt;com.sun.jersey.config.property.packages&lt;/param-name&gt;
            &lt;param-value&gt;sample.first;org.codehaus.jackson.jaxrs;javax.xml.parsers&lt;/param-value&gt;
        &lt;/init-param&gt;
        &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
    &lt;/servlet&gt;
    &lt;servlet-mapping&gt;
        &lt;servlet-name&gt;Jersey REST Service&lt;/servlet-name&gt;
        &lt;url-pattern&gt;/rest/*&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
&lt;/web-app&gt;



    package sample.first;

import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
public class userData {
    public String name;

    public Integer iduser;
}
</code></pre>