On 07/09/11 11:52, Sergey Beryozkin wrote:
Well, you probably need to get ParameterHandler registered to handle
such expressions. If they were structured message payloads then JAXB or
JSON readers would handle it, but in your case it appears you sent
complex JSON expressions as form payloads (in POST case at least) - the
default Form provider can only handle name and value pairs. Likewise, if
such expressions are encoded as GET queries, then JAX-RS has no
contextual info to quess it's a JSON expression, it could've been an
encoded XML sequence too...
So either introduce a custom MessageBodyReader handle form payloads
containing JSON expressions - this reader would delegate to a registered
JSON reader which your custom reader would find via an injected JAX-RS
Providers. Same for ParameterHandler...
Or consider avoiding a dedicated interface dealing with a non-SOAP case

I meant consider 'introducing' :-)


Sergey


On 05/09/11 09:41, CXF user1109 wrote:
Your question : What is a Tree ? How does a query string look like ?

Here is the java class:

public class Constraint {
private List<Term> terms;
private List<Constraint> innerConstraints;
....
}

public class Term {

private String operator;
private Object[] values;
private Long fieldId;
...
}

Json string example :

{"terms":
[{"values":[0.0],"operator":"lessThan","fieldId":54321}],
"innerConstraints":

[{"terms":[{"values":[0.1,0.101],"operator":"between","fieldId":12345},

{"values":[-0.0010,0.0],"operator":"between","fieldId":67890}],
"innerConstraints":[]}
]
}

Service methods are :

@GET
@Path("/test")
List get(@QueryParam("constraint") Constraint constraint,
@QueryParam("value") @DefaultValue("true") boolean value)

@POST
@Path("/test")
@WebMethod(operationName = "test")
List post(@FormParam("constraint") @WebParam(name = "constraint")
Constraint constraint,
@QFormParam("value") @WebParam(name = "value")
@DefaultValue("true") boolean value)


Thank you for your support.

--
View this message in context:
http://cxf.547215.n5.nabble.com/CXF-JAX-RS-support-multiple-request-method-designators-to-one-method-tp4749559p4769680.html

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


Reply via email to