You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by irfannagoo <ir...@gmail.com> on 2012/03/06 16:11:06 UTC
Empty request tag in the wadl
Hi,
I'm using CXF 2.5.1 in WAS 8 container. When I send a wadl request to the
container, I get something like this:
<method name="GET">
<request/>
<response>
<representation mediaType="application/xml"
element="prefix1:authorisation_response"></representation>
</response>
</method>
As it could be seen that response tag is fully populated with correct
representation tag values however, request tag is empty. Surely, I have
added @Consume tag over the GET operation in question in the servlet and I
have also mention @ElementClass with corresponding requests and response
classes. The JAXB2.1 generated request class has @XmlRootElement with
namspace added to it.
I have been trying various way to get the right request tag but no success.
I just can't see Request tag carrying representation tag in it even though
response tag is just perfect. Can any one please help on this?
Thanks,
Irfan
--
View this message in context: http://cxf.547215.n5.nabble.com/Empty-request-tag-in-the-wadl-tp5541117p5541117.html
Sent from the cxf-issues mailing list archive at Nabble.com.
Re: Empty request tag in the wadl
Posted by irfannagoo <ir...@gmail.com>.
Thanks for your help Sergey, I got the representation tag populated with
correct parameters within request tag. Actually, I was passing request with
"@PathParam" annotation and CXF seems to ignore the request attributes while
generating wadl. However, when I passed the request as normal method
parameter (removing the '@PathParam' annotation), I was able to get request
with correct representation tag.
So, the above method signature works just fine.
Thanks,
Irfan
--
View this message in context: http://cxf.547215.n5.nabble.com/Empty-request-tag-in-the-wadl-tp5541117p5543666.html
Sent from the cxf-issues mailing list archive at Nabble.com.
Re: Empty request tag in the wadl
Posted by irfannagoo <ir...@gmail.com>.
Thanks for the information Sergey! I will keep that in mind.
Irfan
--
View this message in context: http://cxf.547215.n5.nabble.com/Empty-request-tag-in-the-wadl-tp5541117p5543840.html
Sent from the cxf-issues mailing list archive at Nabble.com.
Re: Empty request tag in the wadl
Posted by Sergey Beryozkin <sb...@gmail.com>.
On 07/03/12 10:06, irfannagoo wrote:
>
> Thanks for your help Sergey, I got the representation tag populated with
> correct parameters within request tag. Actually, I was passing request with
> "@PathParam" annotation and CXF seems to ignore the request attributes while
> generating wadl
It does not in most cases, even '@PathParam("") AuthorizationData' would
probably work though this option has less sense for @PathParam...
But you have '@PathParam("bar") AuthorizationData' then there's nothing
CXF can do to figure out how to represent AuthorizationData as a
template parameter
Sergey
> However, when I passed the request as normal method
> parameter (removing the '@PathParam' annotation), I was able to get request
> with correct representation tag.
>
>
> Thanks,
> Irfan
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Empty-request-tag-in-the-wadl-tp5541117p5543658.html
> Sent from the cxf-issues mailing list archive at Nabble.com.
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com
Re: Empty request tag in the wadl
Posted by irfannagoo <ir...@gmail.com>.
Thanks for your help Sergey, I got the representation tag populated with
correct parameters within request tag. Actually, I was passing request with
"@PathParam" annotation and CXF seems to ignore the request attributes while
generating wadl. However, when I passed the request as normal method
parameter (removing the '@PathParam' annotation), I was able to get request
with correct representation tag.
Thanks,
Irfan
--
View this message in context: http://cxf.547215.n5.nabble.com/Empty-request-tag-in-the-wadl-tp5541117p5543658.html
Sent from the cxf-issues mailing list archive at Nabble.com.
Re: Empty request tag in the wadl
Posted by irfannagoo <ir...@gmail.com>.
Something like this:
@POST
@Path("/post")
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.APPLICATION_XML)
@ElementClass(request = AuthorisationRequest.class, response =
AuthorisationResponse.class)
public Response testPOST(@Context HttpHeaders headers, AuthorisationRequest
request)
{
}
Thanks, Irfan
--
View this message in context: http://cxf.547215.n5.nabble.com/Empty-request-tag-in-the-wadl-tp5541117p5543636.html
Sent from the cxf-issues mailing list archive at Nabble.com.
Re: Empty request tag in the wadl
Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi, how does the method signature look like, ex, of the method dealing
with POST ?
Sergey
On 07/03/12 09:37, irfannagoo wrote:
>
> Thanks for the response Sergey!
>
> Actually, request tag in generated wadl is empty for all operations like
> PUT, POST etc. even though I'm passing JAXB generated
> "authorisation_request" object to these operation. I expect to see fully
> populated representation tag within the request tag of wadl. Something like
> this:
>
> <method name="POST/GET">
> <request>
> <representation mediaType="application/xml"
> element="prefix1:authorisation_request"></representation>
> <request/>
> <response>
> <representation mediaType="application/xml"
> element="prefix2:authorisation_response"></representation>
> </response>
> </method>
>
>
> I'm not sure what is preventing CXF to generate the request tag even though
> response tag is all correct.
>
>
> Thanks, Irfan
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Empty-request-tag-in-the-wadl-tp5541117p5543606.html
> Sent from the cxf-issues mailing list archive at Nabble.com.
Re: Empty request tag in the wadl
Posted by irfannagoo <ir...@gmail.com>.
Thanks for the response Sergey!
Actually, request tag in generated wadl is empty for all operations like
PUT, POST etc. even though I'm passing JAXB generated
"authorisation_request" object to these operation. I expect to see fully
populated representation tag within the request tag of wadl. Something like
this:
<method name="POST/GET">
<request>
<representation mediaType="application/xml"
element="prefix1:authorisation_request"></representation>
<request/>
<response>
<representation mediaType="application/xml"
element="prefix2:authorisation_response"></representation>
</response>
</method>
I'm not sure what is preventing CXF to generate the request tag even though
response tag is all correct.
Thanks, Irfan
--
View this message in context: http://cxf.547215.n5.nabble.com/Empty-request-tag-in-the-wadl-tp5541117p5543606.html
Sent from the cxf-issues mailing list archive at Nabble.com.
Re: Empty request tag in the wadl
Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On 06/03/12 15:11, irfannagoo wrote:
> Hi,
>
> I'm using CXF 2.5.1 in WAS 8 container. When I send a wadl request to the
> container, I get something like this:
>
> <method name="GET">
> <request/>
> <response>
> <representation mediaType="application/xml"
> element="prefix1:authorisation_response"></representation>
> </response>
> </method>
>
> As it could be seen that response tag is fully populated with correct
> representation tag values however, request tag is empty. Surely, I have
> added @Consume tag over the GET operation in question in the servlet and I
> have also mention @ElementClass with corresponding requests and response
> classes. The JAXB2.1 generated request class has @XmlRootElement with
> namspace added to it.
>
> I have been trying various way to get the right request tag but no success.
> I just can't see Request tag carrying representation tag in it even though
> response tag is just perfect. Can any one please help on this?
>
It's probably to do with the fact GET is not supposed to have incoming
message payloads. What exactly do you expect to see there ?
Cheers, Sergey
>
> Thanks,
> Irfan
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Empty-request-tag-in-the-wadl-tp5541117p5541117.html
> Sent from the cxf-issues mailing list archive at Nabble.com.
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com