Results 1 to 1 of 1
- 05-06-2010, 11:40 AM #1
Member
- Join Date
- May 2010
- Posts
- 9
- Rep Power
- 0
Invocation of Restful services thru POST request
Hi,
I am new to Restful services. I have designed a sample restful web service. Following is my resource class
package project1;
import javax.ws.rs.Path;
import javax.ws.rs.GET;
import javax.ws.rs.Produces;
@Path("/helloworld")
public class HelloRS {
// The Java method will process HTTP GET requests
@GET
// The Java method will produce content identified by the MIME Media
// type "text/plain"
@Produces("text/plain")
public String getClichedMessage() {
// Return some cliched textual content
return "Hello World";
}
@POST
// The Java method will produce content identified by the MIME Media
// type "text/plain"
@Path("post")
@Produces("text/plain")
public String getPostMessage() {
// Return some cliched textual content
return "Post Request";
}
}
I am deploying it as a war file in weblogic app server. I am able to invoke the GET requests using the url http://localhost:port/<context-root>/helloworld. But my POST requests are not working. The url to pass the post request is not working .... http://localhost:port/<context-root>/helloworld/post.
Please tell me to how to make a post request.
Thanks
Neha
Similar Threads
-
RESTful Web Service
By aakinn in forum New To JavaReplies: 0Last Post: 04-13-2010, 04:06 PM -
DOnt know if 1st post if did, I am VERY sorry for duplicate post. I have error messg
By afisher300 in forum New To JavaReplies: 3Last Post: 05-04-2009, 03:15 AM -
Web Services: Axis vs Metro vs Spring Web Services
By davidbaker29 in forum Advanced JavaReplies: 0Last Post: 01-28-2009, 11:20 AM -
First post as per request
By happyknappy in forum IntroductionsReplies: 3Last Post: 07-30-2008, 01:33 AM -
How to post HTTPS request from java client to server
By Desai in forum NetworkingReplies: 1Last Post: 07-14-2007, 05:15 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks