aspose file tools*
The moose likes Web Services and the fly likes @FormParam with CXF 2.2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "@FormParam with CXF 2.2" Watch "@FormParam with CXF 2.2" New topic
Author

@FormParam with CXF 2.2

Saathvik Reddy
Ranch Hand

Joined: Jun 03, 2005
Posts: 228
Hi,

I am using CXF 2.2 for implementing restful services. I have a post method in the service
Ex:
@POST
@Path("/login")
public boolean login(@FormParam("userName") String userName,
@FormParam("password") String password )

I am not able to get the form param values in the service class there are always null. Does CXF 2.2 support @FromParam? If yes, is there any configuration to make it to work?

I am using apache commons http client to test my service:
Ex:
PostMethod post = new PostMethod("http://localhost:8080/rest/login");
post.addParameter("userName", "testuser");
post.addParameter("password", "testpassword");

HttpClient httpclient = new HttpClient();
int result = httpclient.executeMethod(post);

Could any one suggest me where am i doing wrong?

Thanks,
Saathvik Reddy
Ranch Hand

Joined: Jun 03, 2005
Posts: 228
I realized i made a silly mistake. It works now.

Thanks,
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: @FormParam with CXF 2.2
 
Similar Threads
request timeout error.
CXF 2.2 @FormParam - Not working?
HTTP Post SSL certificates (Jakarta HTTP Commons)
how to send user credentials to a protected restful webservice
Java with curl (http://curl.haxx.se/)