0

I would like to log the xml produced from this. How can I do this ?

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


      }
    }

UPDATE

why i need this is because , I want to have database logging with the request and response header, body etc

mosaad
  • 2,276
  • 5
  • 27
  • 49

1 Answers1

0

Not sure what you mean by log -- do you mean display on a web page? So assuming the CustomerList is annotated and the Customer class is also annotated and each has getters and setters.

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

  }

This is assuming you are trying to create a Restful service: JAX-RS.

Tony
  • 345
  • 1
  • 4
  • 11