You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by chengy <ch...@yahoo.com.cn> on 2010/07/16 05:40:26 UTC

a JAX-RS Produce problem

hi,I dont know is this a bug,I use cxf 2.2.5:

My java code:

	@POST
	@Path("/getInt")
	@Produces("text/plain")
             @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
	public int getInt(@FormParam("input") int input) {
		return input;
	}

this will generate the wadl:

<resource path="/getInt">
<method name="POST">
 <request>
  <representation mediaType="text/plain">
     
  </representation>
</request>

 <response>
   <representation mediaType="text/plain" /> 
 </response>
 </method>
</resource>

the mediaType of request is "text/plain",not
MediaType.APPLICATION_FORM_URLENCODED,why???
-- 
View this message in context: http://cxf.547215.n5.nabble.com/a-JAX-RS-Produce-problem-tp1223880p1223880.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: a JAX-RS Produce problem

Posted by chengy <ch...@yahoo.com.cn>.
I think this is a bug.
-- 
View this message in context: http://cxf.547215.n5.nabble.com/a-JAX-RS-Produce-problem-tp1223880p1800830.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: a JAX-RS Produce problem

Posted by chengy <ch...@yahoo.com.cn>.
I want wadl below,but I cant do this when using cxf 2.2.5 or 2.2.9:

<resource path="/getInt"> 
<method name="POST"> 
 <request> 
  <representation mediaType="application/x-www-form-urlencoded"> 
      
  </representation> 
</request> 

 <response> 
   <representation mediaType="text/plain" /> 
 </response> 
 </method> 
</resource> 


when not asign this Produce, the wadl <representation mediaType="*/*" /> to
int type will be a "octet-stream" mediatype response

-- 
View this message in context: http://cxf.547215.n5.nabble.com/a-JAX-RS-Produce-problem-tp1223880p1800726.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: a JAX-RS Produce problem

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi - this is a 2.2.5 issue (I think it is just defaulting to text/plain) but
in 2.2.9 you'll see form params as request parameters of type "query", this
is according to the (wadl) spec

cheers, Sergey

On Fri, Jul 16, 2010 at 4:40 AM, chengy <ch...@yahoo.com.cn> wrote:

>
> hi,I dont know is this a bug,I use cxf 2.2.5:
>
> My java code:
>
>        @POST
>        @Path("/getInt")
>        @Produces("text/plain")
>             @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
>        public int getInt(@FormParam("input") int input) {
>                return input;
>        }
>
> this will generate the wadl:
>
> <resource path="/getInt">
> <method name="POST">
>  <request>
>  <representation mediaType="text/plain">
>
>  </representation>
> </request>
>
>  <response>
>   <representation mediaType="text/plain" />
>  </response>
>  </method>
> </resource>
>
> the mediaType of request is "text/plain",not
> MediaType.APPLICATION_FORM_URLENCODED,why???
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/a-JAX-RS-Produce-problem-tp1223880p1223880.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>