I am using restEasy(Restful implementation for
jboss) ejb3.0, Jboss5.1.1 AS
I did restful service which accepting simple object.
this is at the server side:
@POST
@Path("testObjects")
@Consumes("application/xml")
@Produces("text/plain")
public
String testObjects(GrandSun sun)
{
System.out.println(sun.toString());
return "success";
}
this is the object which I have declared at the server side:
package com.mirs.wma.web.data;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
public class GrandSun
{
int m = 1;
int g = 2;
}
I
test it via restfull client which sending xml string and it works fine.
<?xml version="1.0" encoding="UTF-8"?>
<grandSun>
<m>111</m>
<g>22</g>
</grandSun>
What I am looking for is a restful client which will be able to send the whole object (as is) without needing me to convert manually to xml format.
Is there any option to do it via annotation?
I will just need to annotate the object at the client side and send it as is to the restful service?
thanks,