Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6610741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:52:45+00:00 2026-05-25T19:52:45+00:00

I am creating restful web service and i wanted to know how do we

  • 0

I am creating restful web service and i wanted to know how do we create a service with input parameters and also how to invoke it from a web browser.

For example

@Path("/todo")
public class TodoResource {
    // This method is called if XMLis request
    @PUT
    @Produces( {MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON})
    public Todo getXML() {
        Todo todo = new Todo();
        todo.setSummary("This is my first todo");
        todo.setDescription("This is my first todo");
        return todo;
    }

and i can invoke it using
http://localhost:8088/JerseyJAXB/rest/todo

and I want to create a method like

@Path("/todo")
    public class TodoResource {
        // This method is called if XMLis request
        @PUT
        @Produces( {MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON})
        public Todo getXML(String x, String y) {
            Todo todo = new Todo();
            todo.setSummary(x);
            todo.setDescription(y);
            return todo;
        }

In case of soap based web services i would invoke it like this

http://localhost:8088/JerseyJAXB/rest/todo?x=abc&y=pqr

but I want to know how to invoke it using rest and also can I pass the parameters as I am doing in the above example when I use rest and jersey.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:52:45+00:00Added an answer on May 25, 2026 at 7:52 pm

    You can.
    Try something like this:

    @Path("/todo/{varX}/{varY}")
    @Produces({"application/xml", "application/json"})
    public Todo whatEverNameYouLike(@PathParam("varX") String varX,
        @PathParam("varY") String varY) {
            Todo todo = new Todo();
            todo.setSummary(varX);
            todo.setDescription(varY);
            return todo;
    }
    

    Then call your service with this URL;
    http://localhost:8088/JerseyJAXB/rest/todo/summary/description

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been working off an example (http://bdoughan.blogspot.com/2010/08/creating-restful-web-service-part-45.html) and I've been debugging some issues and
I follow tutorial here on how to create web service using RESTful web service
I've been assigned to create an RESTful Android application for an existing web service
I am creating a web-based RESTful service and want to cloud-enable it for scalability.
I am considering creating a RESTful web service which will return a lot of
I'm creating a post to send to a RESTful web service, my current code
I am creating a Restful WCF web service which will need to be consumed
I'm creating a RESTful web service that allows me to import documents by name.
I am creating a RESTful API web service and I need a way of
I just noticed while creating a RESTful WCF service that the Method parameter on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.