I would like to enable dumping of HTTP headers in a JAX-WS RI client.
I do not want to dump the actual content, only the headers. Beware that under the hood JAX-WS RI uses HttpURLConnection so please don't reply with something related to Apache's HttpClient.
I need to enable it programmatically, not by way of a configuration file.
I'm aware of the answer on this question, but I'm really struggling to make that work with Java 7 so I'm wondering if I'm going about this the wrong way. In essence what I want to do is to be able to see the HTTP headers on the http traffic underlying JAX-WS and I don't really care how it is achieved as long as I can enable it programmatically.
This section of JAX-WS guide about using handlers to access HTTP headers might help.