0 Replies Latest reply on Aug 11, 2010 10:45 AM by Andre Zelenkovas

    Setting outbound HTTP header from JAX-WS handler does not work

    Andre Zelenkovas Newbie

      Hello

       

      I'm trying to set an outbound HTTP header in a JAX-WS handler with no success.

       

      Here's the code snippet:

       

      private static final String PERFORMANCE_HTTP_HEADER = "X-Perf";

       

      private void logPerformance(SOAPMessageContext smc) {

                         ...

                          @SuppressWarnings("unchecked")
                          Map<String,List<String>> headers = (Map<String,List<String>>) smc.get(MessageContext.HTTP_RESPONSE_HEADERS);
                          if (null == headers) {
                              headers = new HashMap<String,List<String>>();
                          }
                          headers.put(PERFORMANCE_HTTP_HEADER, Collections.singletonList(msg));
                          smc.put(MessageContext.HTTP_RESPONSE_HEADERS, headers);

      The header doesn't show up in the response.

       

      Any ideas would be greatly appreciated.

       

      Thanks

      Andre