Java 在将输出发送到JAX-RSWeb服务客户端之前,打印MOXy生成的XML
在服务器端使用MOXy打印XML时,如何打印MOXy生成的XML,然后再将XML发送到restfulweb服务客户端Java 在将输出发送到JAX-RSWeb服务客户端之前,打印MOXy生成的XML,java,eclipselink,jax-rs,moxy,Java,Eclipselink,Jax Rs,Moxy,在服务器端使用MOXy打印XML时,如何打印MOXy生成的XML,然后再将XML发送到restfulweb服务客户端 @GET @Path("/sma") @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public Representation getRepresentation() throws Exception { Representation rep=
@GET
@Path("/sma")
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Representation getRepresentation() throws Exception
{
Representation rep= new Representation ();
rep.setFirstName("first name");
rep.setLastName("last name");
return rep;
}
在上面的示例中,您希望在将其发送到Web服务客户端之前打印表示对象XML。非常感谢您的帮助。。。
@GET
@Path("/sma")
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Representation getRepresentation() throws Exception
{
Representation rep= new Representation ();
rep.setFirstName("first name");
rep.setLastName("last name");
return rep;
}