InfoPath does not support accessing the headers, but you can add a web reference to your InfoPath form in Visual Studio and call within your form code.
This is a sample using a webservice defined method with
MyWebService.Auth hdr = new global::InfoPathProject2.MyWebService.Auth();
hdr.Username = ''Fred'';
hdr.Password = ...