wsdl2java generate java code based on wsdl provided because the wsdl is the data contract between the producer and consumer.
If the consumer would like to get header information. The best is that the wsdl contains methods to get header data.
If the wsdl did not describe it, special handling may be required. You may directly get the header information by the response or by interceptors.
My way is that the interceptor capture the header information and then throws fault exception. The method catch the exception and then get the header information. It seems a dirty way but work for me.