0 Replies Latest reply on May 4, 2012 9:26 AM by ziggy25

    RestEasy - Is it possible to extract the request exactly as it came in?

    ziggy25

      I have a web service that is processed on the Spring end as follows:

          @POST
         
      @Path("/processRequest")
         
      @Consumes("multipart/mixed")
         
      @ResponseStatus(HttpStatus.OK)
         
      public String processRequest(@Context ServletContext servletContext, MultipartInput input) {

             
      return addAccout(servletContext, input);
         
      }

      The request will come in as a multipart/mixed request and will look something like this:

      --productBoundary
      Content-Type: text/xml

      <?xml version="1.0" encoding="UTF-8"?>
      <product>
          
      <name>ProductA</name>
      </product>

      --productBoundary
      Content-Type: text/xml

      ZGF0YRBAAABn5
      ///////////////5///Z+fn///n////////5////////2f//2f//+f//+f////n/
      ///////52f//////2f//////2f/////5////////+f/////Z+f///////////////9n//9nZ/9n////5+f///9
      <snip>
      //+f//////2f/////////5//n//////////9n

      --productBoundary--

      The request will come in as a mutipart/mixed. I can use Resteasy's object shown in the processRequest's method parameters to extract each part of the multipart/mixed message. What i would like to do though is to get the message as it is unmodified with its headers and everything else. Is this possible?

       

      I need to be able to store the request exactly as it came in. Using the RestEasy MultipartInput structure means i have modified the request. Is there anyway i can get the request as it came in with all its headers without modifying it?