How to Build Block Header in stratum? When I studied the stratum on here,I found that there were little difference between the stratum and solo mining for building block header.

The stratum tell us that we needed to pad the header to uint512.

'000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000'

The bits is different to the algorithm of sha256's padding. 

But when I practiced the example which solved testnet3 block,I couldn't use the information to calculate the hash until I discarded the padding.

In real-work,whether I need to pad or not?

By the way,the previous hash provided from  notification is not correct,you need to find it on there.
You do not need append padding, this step already implemented under the hood in the cryptographic library function sha256. As I remember, when I solve the same task and read this doc from stratum pool a few inconsistencies in the documentation that had to be solved empirically. 

One of the nuances on which note that miners software do not know anything about the segwit and coinbase transaction for the miner job should be represented in the old format.