2013-10-22 18 views
0

我想记录从此产生的xml。我怎样才能做到这一点 ?如何获得从jax-rs生成的xml?

@GET 
    @Path("add") 
    @Producse("application/xml") 
    public List<String>getCustomerList(....) { 


     } 
    } 

UPDATE

为什么我需要这是因为,我想与您记录的意思的请求和响应头部,身体等

+0

出于调试目的或其他原因? –

+0

我想你需要方法拦截器http://pic.dhe.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=%2Fcom.ibm.websphere.nd.multiplatform.doc%2Finfo%2Fae%2Fae% 2Ftwbs_jaxrs_jcdi_decoratorsandmethod.html –

+0

@RomanVottner我正在使用wink – mosaad

回答

0

不知道数据库日志 - DO你的意思是在网页上显示? 因此,假设CustomerList被注释并且Customer类也被注释,并且每个都有getter和setter。

@GET 
@Path("add") 
@Produces(MediaType.APPLICATION_XML) 
public Response returnListOfCustomers() { 
    CustomerList returnMe = this.getMyCustomerList(); // <-- Made this method up 
    return Response.ok(returnMe).build() 

    } 

这假设您正在尝试创建一个Restful服务:JAX-RS。