简体   繁体   English

Restlet客户端返回null

[英]Restlet client returns null

I have an jax-rs annotated interface 我有一个带有jax-rs注释的界面

public interface Store {

    @Path("/apipath")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
public Token login(@BeanParam Header header, 
        @FormParam(value = "type") String type);        

}

Token is a class annotated with jaxb annotations. 令牌是带有jaxb注释的类。

I want to use this interface as a client proxy. 我想将此接口用作客户端代理。

Store s = new ClientResource(url).wrap(Store.class);
Token t = s.login(...);

The returned token is always null. 返回的令牌始终为null。 No exception is thrown. 没有异常被抛出。 If i use the same interface but as a jax-rs implementation i choose either cxf or resteasy the method returns non-null object with correct data. 如果我使用相同的接口但作为jax-rs实现,则选择cxf或resteasy,该方法将返回具有正确数据的非null对象。

im using org.restlet.ext.jaxrs 2.3.3, org.restlet.ext.jackson 2.3.3, org.restlet.ext.jaxb 2.3.1 即时通讯使用org.restlet.ext.jaxrs 2.3.3,org.restlet.ext.jackson 2.3.3,org.restlet.ext.jaxb 2.3.1

The ClientResource class and its wrap method only supports native Restlet annotations (like @Get , @Post , ...). ClientResource类及其wrap方法仅支持本机Restlet注释(如@Get@Post ,...)。 The JaxRsClientResource does something similar but in the context of JAX-RS. JaxRsClientResource功能类似,但在JAX-RS的上下文中。

Hope it helps you, Thierry 希望对您有帮助,蒂埃里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM