Hi

On 26/04/12 13:01, imiten wrote:
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 ?

Probably to do with setting '/mkyong_webapp' in the form action value, not sure. Try adding a CXF Logging Feature (within jaxrs:features block), that will give you the info about the request. Setting it log level to DEBUG would also provide all the info, but the logging feature is less verbose by default

Cheers, Sergey


@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.


--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to