[
https://issues.apache.org/jira/browse/CXF-5108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13702930#comment-13702930
]
Sambit Dikshit commented on CXF-5108:
-------------------------------------
Hi Sergey,
I tried with following book class. It failed because it tries to find the
keys for methods like isEmpty in HashMap. Suppose you have one attribute in
the bean which is a map and which is initialized as an empty HashMap. Then when
it tries to find params it fails.
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Book")
@XmlRootElement(name = "Book")
public class Book implements Serializable {
private String name;
private long id;
private Map<Long, Chapter> chapters = new HashMap<Long,Chapter>();
public Book() {
}
public Book(String name, long id) {
this.name = name;
this.id = id;
}
public void setName(String n) {
name = n;
}
public String getName() {
return name;
}
public void setId(long i) {
id = i;
}
public long getId() {
return id;
}
public Map<Long, Chapter> getChapters() {
return chapters;
}
public void setChapters(Map<Long, Chapter> chapters) {
this.chapters = chapters;
}
}
You can try the same test case with the above bean and let me know.
> parameter beans feature not working through dynamic proxy based clients for
> JAXRS
> ---------------------------------------------------------------------------------
>
> Key: CXF-5108
> URL: https://issues.apache.org/jira/browse/CXF-5108
> Project: CXF
> Issue Type: Bug
> Components: Core, JAX-RS
> Affects Versions: 2.7.3, 2.7.5
> Reporter: Sambit Dikshit
> Assignee: Sergey Beryozkin
>
> We have a resource method declared as below.
> @Path("/books")
> @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
> Book searchBook(@QueryParam("") Book book) throws ServiceException;
> Here the query param can be any combination of property of the book bean
> which are searchable.
> When we construct the URL with appropriate query string and use the web
> client, it works fine.
> But it does not work when some one is using the proxy based approach where
> the client get hold of the interface for e.g BookStoreResourceI and try to
> get call the searchBook(Book b) method on that resource interface.
> When debug found that, the client side conversion for cases like
> @QueryParam("")
> @PathParam(""), @MatrixParam("") are missing and its being implemented in
> the JAXRSInvoker.invoke operation just before invoking the resource
> API/method.
> We need to have this feature of conversion from these parameter types to
> actual URL so that irrespective of which type of client is consuming your
> service, it will work. Otherwise it will become a half baked client
> consumption model.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira