Hi
On 07/06/13 10:13, Gonzalo Aguilar Delgado wrote:
Hello,
I'm using CXF to create some services. I've found that complex input
parameters are not generated on description. So they cannot be handled
right by clients.
@GET
@Path("/list/detail/{query}/get")
@WebMethod(operationName = "queryDetails")
@WebResult(name = "response")
public ServiceResponse<?> queryDetails(
@Description("Query to be performed on server")
@WebParam(name="query")
@PathParam("query") @QueryParam("query") MerchantQuery query);
-----
MerchantQuery is defined with setters and getters like this:
@XmlRootElement(name = "MerchantQuery")
@XmlType(name = "MerchantQuery", namespace =
"http://api.enterprise.level2crm.com")
public class MerchantQuery implements IMerchantQuery {
private static Logger log =
LoggerFactory.getLogger(MerchantQuery.class);
private String contactPerson;
private String contactEmail;
private String fullName;
private String otherName;
private String neighborhoodCode;
private String idCountry;
private String url;
private String contactPhone;
private String postalCode;
public MerchantQuery() {
}
...
But WADL skip it! Everything on Response it's handled right. Why not
input values?
What should I do to force generator do what it does with response values?
Like this one:
<xs:complexType name="MerchantDetailData"><xs:sequence><xs:element
minOccurs="0" name="details" type="tns:MerchantDetailDTO"/><xs:element
minOccurs="0" name="identifiers"
type="tns:ResponseDataList"/><xs:element minOccurs="0" name="location"
type="tns:ResponseDataList"/></xs:sequence></xs:complexType>
The problem is you have the following:
public ServiceResponse<?> queryDetails(
@Description("Query to be performed on server")
@WebParam(name="query")
@PathParam("query") @QueryParam("query") MerchantQuery
query);
The first minor issue is that both @PathParam and @QueryParam are
available, choose one of them.
That said, the reason that no schema is generated is that @PathParam and
@QueryParam will identify some portion of request URI, which can not be
an XML fragment. If you had
public ServiceResponse<?> queryDetails(
@Description("Query to be performed on server")
@WebParam(name="query")
MerchantQuery query);
Then the schema would be generated,
Sergey
Thank you.