You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by imiten <im...@yahoo.com> on 2012/04/25 14:58:44 UTC

Get parameter not mapping

Hi,

I have below two methods for CXF Rest. The getProducts returns list but
getProduct(int id) fails with error:
org.apache.cxf.interceptor.Fault: Invalid URL/Verb combination. Verb: GET
Path: /product/9


@WebResult(name="product")
@Path("/product/{product_id}")
@Get
public Product getProduct(@PathParam("product_id")int id);

@WebResult(name="product_list")
@Get
@Path("/products")
public List<Product> getProducts();


When method has @Post then incoming xml elements will be mapped to method
parameters using PathParam or WebParam ?

Regards,

Miten.

--
View this message in context: http://cxf.547215.n5.nabble.com/Get-parameter-not-mapping-tp5664787p5664787.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Get parameter not mapping

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi Miten
On 25/04/12 16:18, imiten wrote:
> Hi,
>
> I thought this was not related to http binding as I am using Path, PathParam
> which I thought as jaxrs.  Anyways if I am wrong excuse me as I am just
> learning.
>
np at all
> Based upon the reply it sounds like I should upgrade from 2.5.2 to 2.6.0
> which I now shall work on.
>
You don't have to, JAX-RS is supported on the active CXF branches and 
the trunk.
Perhaps you should try running a couple of basic JAX-RS demos available 
in samples/jax_rs in CXF distributions. A lot of info is also available 
here:
http://cxf.apache.org/docs/jax-rs.html

Cheers, Sergey
> Regards,
>
> Miten.
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Get-parameter-not-mapping-tp5664787p5665155.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

Re: Get parameter not mapping

Posted by imiten <im...@yahoo.com>.
Hi,

I thought this was not related to http binding as I am using Path, PathParam
which I thought as jaxrs.  Anyways if I am wrong excuse me as I am just
learning.  

Based upon the reply it sounds like I should upgrade from 2.5.2 to 2.6.0
which I now shall work on.

Regards,

Miten.

--
View this message in context: http://cxf.547215.n5.nabble.com/Get-parameter-not-mapping-tp5664787p5665155.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Get parameter not mapping

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi Miten

As I mentioned in the previous email, CXF HTTP Binding has been 
deprecated and has been completely removed from 2.6.0. It's still 
available in 2.3.x-2.5.x but I do no recall any fixes going into it for 
the last couple of years or so.

If you do need to work with this binding say in 2.5.x then consider 
creating a patch for a problem below

Cheers, Sergey
On 25/04/12 13:58, imiten wrote:
> Hi,
>
> I have below two methods for CXF Rest. The getProducts returns list but
> getProduct(int id) fails with error:
> org.apache.cxf.interceptor.Fault: Invalid URL/Verb combination. Verb: GET
> Path: /product/9
>
>
> @WebResult(name="product")
> @Path("/product/{product_id}")
> @Get
> public Product getProduct(@PathParam("product_id")int id);
>
> @WebResult(name="product_list")
> @Get
> @Path("/products")
> public List<Product>  getProducts();
>
>
> When method has @Post then incoming xml elements will be mapped to method
> parameters using PathParam or WebParam ?
>
> Regards,
>
> Miten.
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Get-parameter-not-mapping-tp5664787p5664787.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