You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by deniak <de...@gmail.com> on 2008/07/02 15:48:01 UTC

Post method with multiple parameters

Hi all,

Have you ever tried to use a post method with multiple parameters like:

@Path("test")
public class myClass{
        @POST
	@Path("/post")
	public Response myMethod(ANewClass classA, AnotherClass classB){
		return Response.ok().build();
	}
}

I don't know how to deal with multiple parameters... Can you give me a
simple example?
Thanks
-- 
View this message in context: http://www.nabble.com/Post-method-with-multiple-parameters-tp18237851p18237851.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Post method with multiple parameters

Posted by Sergey Beryozkin <se...@iona.com>.
Hi

I don't see how it can be supported in the short term given that JAX-RS mandates that
a given method may contain only a single parameter which is not annotated by JAX-RS annotations and which
is assumed to represent an (input) body.

In the longer term I reckon this feature can be supported by using a CXF-private blocking filter (just added) which can
unwrap the request XML into multiple fragments (by taking all the siblings of the root element instance), invoke the method and
return a Response. Such extension can even handle simple  SOAP requests - that would be fun. In fact, given that the filters are
already supported, perhaps someone can investigate the feasibility of creating such an extension, perhaps reusing some of the code
done by
the JAX-WS runtime.

By the way, I thought you were after submitting XML through a query parameter ? File uploads are not supported by CXF JAX-RS - but
it's something that will need to be done, that's for sure.

Cheers, Sergey

>I think it should be something that's supported and if I had the time, I'd
> love to do the work.  Submitting XML via multiple parameters and file
> uploads would be a useful addition, especially when developing simple
> 'test harness' web interfaces...
>
>
> John Baker
> -- 
> Web SSO
> IT Infrastructure
> Deutsche Bank London
>
> URL:  http://websso.cto.gt.intranet.db.com
>
>
>
>
> deniak <de...@gmail.com>
> 02/07/2008 15:26
> Please respond to
> users@cxf.apache.org
>
>
> To
> users@cxf.apache.org
> cc
>
> Subject
> Re: Post method with multiple parameters
>
>
>
>
>
>
>
> Ok, I just read the cxf user's guide:
> http://cwiki.apache.org/CXF20DOC/http-binding.html
>
> At the section "Wrapped vs. Unwrapped Mode", we can read
> we can only send and receive one XML element.
>
> Tell me if i'm wrong but, as John said, it's impossible to use 2 objects
> parameters
> in a post method....
>
>
>
>
> Hi,
>
> I discussed this a couple months ago, and the conclusion I came to is that
>
> you can not unless you write some code to parse the request.  I wanted to
> submit XML via a file attachment.
>
>
> John Baker
> -- 
> Web SSO
> IT Infrastructure
> Deutsche Bank London
>
> URL:  http://websso.cto.gt.intranet.db.com
>
>
>
>
> -- 
> View this message in context:
> http://www.nabble.com/Post-method-with-multiple-parameters-tp18237851p18238699.html
>
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>
>
>
> ---
>
> This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this
> e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution
> of the material in this e-mail is strictly forbidden.
>
> Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and regulatory disclosures.

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Re: Post method with multiple parameters

Posted by John-M Baker <jo...@db.com>.
I think it should be something that's supported and if I had the time, I'd 
love to do the work.  Submitting XML via multiple parameters and file 
uploads would be a useful addition, especially when developing simple 
'test harness' web interfaces...


John Baker
-- 
Web SSO 
IT Infrastructure 
Deutsche Bank London

URL:  http://websso.cto.gt.intranet.db.com




deniak <de...@gmail.com> 
02/07/2008 15:26
Please respond to
users@cxf.apache.org


To
users@cxf.apache.org
cc

Subject
Re: Post method with multiple parameters







Ok, I just read the cxf user's guide:
http://cwiki.apache.org/CXF20DOC/http-binding.html

At the section "Wrapped vs. Unwrapped Mode", we can read
we can only send and receive one XML element.

Tell me if i'm wrong but, as John said, it's impossible to use 2 objects
parameters
in a post method....




Hi,

I discussed this a couple months ago, and the conclusion I came to is that 

you can not unless you write some code to parse the request.  I wanted to 
submit XML via a file attachment.


John Baker
-- 
Web SSO 
IT Infrastructure 
Deutsche Bank London

URL:  http://websso.cto.gt.intranet.db.com




-- 
View this message in context: 
http://www.nabble.com/Post-method-with-multiple-parameters-tp18237851p18238699.html

Sent from the cxf-user mailing list archive at Nabble.com.




---

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and regulatory disclosures.

Re: Post method with multiple parameters

Posted by deniak <de...@gmail.com>.
Ok, I just read the cxf user's guide:
http://cwiki.apache.org/CXF20DOC/http-binding.html

At the section "Wrapped vs. Unwrapped Mode", we can read
we can only send and receive one XML element.

Tell me if i'm wrong but, as John said, it's impossible to use 2 objects
parameters
in a post method....




Hi,

I discussed this a couple months ago, and the conclusion I came to is that 
you can not unless you write some code to parse the request.  I wanted to 
submit XML via a file attachment.


John Baker
-- 
Web SSO 
IT Infrastructure 
Deutsche Bank London

URL:  http://websso.cto.gt.intranet.db.com




-- 
View this message in context: http://www.nabble.com/Post-method-with-multiple-parameters-tp18237851p18238699.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Post method with multiple parameters

Posted by John-M Baker <jo...@db.com>.
Hi,

I discussed this a couple months ago, and the conclusion I came to is that 
you can not unless you write some code to parse the request.  I wanted to 
submit XML via a file attachment.


John Baker
-- 
Web SSO 
IT Infrastructure 
Deutsche Bank London

URL:  http://websso.cto.gt.intranet.db.com




deniak <de...@gmail.com> 
02/07/2008 14:48
Please respond to
users@cxf.apache.org


To
users@cxf.apache.org
cc

Subject
Post method with multiple parameters







Hi all,

Have you ever tried to use a post method with multiple parameters like:

@Path("test")
public class myClass{
        @POST
                 @Path("/post")
                 public Response myMethod(ANewClass classA, AnotherClass 
classB){
                                 return Response.ok().build();
                 }
}

I don't know how to deal with multiple parameters... Can you give me a
simple example?
Thanks
-- 
View this message in context: 
http://www.nabble.com/Post-method-with-multiple-parameters-tp18237851p18237851.html

Sent from the cxf-user mailing list archive at Nabble.com.




---

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional EU corporate and regulatory disclosures.