Hello Miten,

I would guess, that your form is using a different enctype than defined at the 
@Consumes annotation.

Please take a look here: 
http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4

Does your enctype equals "application/x-www-form-urlencoded" or 
"multipart/form-data"?


best regards,
Marko

Am 26.04.2012 14:01, schrieb imiten:
> Hi,
>
> I have below method defined so I can use form post to Restful webmethod.
> But the service cannot map the path to any matching method.  Other methods
> which are not form consumers work fine.
>
> does not work for url in form action:
> "/mkyong_webapp/services/rest/product/product_id".  I have even tried
> changing to @Path("/form/product_id") and corresponding action to
> "/mkyong_webapp/services/rest/product/form/product_id" but they do not match
> any method.  am I missing some thing ?
>
> @Path("/product_id")
> @POST
> @Produces("application/xml")
> @Consumes("application/x-www-form-unrlencoded")
> public Product getProductForm(@FormParam("product_id") int id) {
>       // TODO Auto-generated method stub
>       return productBo.getProduct(id);
> }
>
>
> example working method is for url
> http://localhost:8080/mkyong_webapp/services/rest/product/list:
> @GET
> @Path("/list")
> @Produces("application/xml")
> public ProductContainer getProducts() {
>       // TODO Auto-generated method stub
>       ProductContainer pc = new ProductContainer();
>       pc.p = productBo.getProducts();
>       return pc;
> }
>
>
> Regards,
>
> Miten.
>
>
>
> --
> View this message in context: 
> http://cxf.547215.n5.nabble.com/form-post-to-restful-service-not-finding-matching-method-tp5667389p5667389.html
> Sent from the cxf-user mailing list archive at Nabble.com.


-- 
Marko Voß
ePublishing & eScience
Development & Applied Research
Phone +49 7247 808-744
Fax +49 7247 808-133
[email protected]


FIZ Karlsruhe - Leibniz Institute for Information Infrastructure
Hermann-von-Helmholtz-Platz 1
76344 Eggenstein-Leopoldshafen, Germany

www.fiz-karlsruhe.de


-------------------------------------------------------

Fachinformationszentrum Karlsruhe, Gesellschaft für wissenschaftlich-technische 
Information mbH. 
Sitz der Gesellschaft: Eggenstein-Leopoldshafen, Amtsgericht Mannheim HRB 
101892. 
Geschäftsführerin: Sabine Brünger-Weilandt. 
Vorsitzender des Aufsichtsrats: MinDirig Dr. Thomas Greiner.


Reply via email to