The temperature dependence of the $ab$-plane optical reflectivity of Ba(Fe$_{0.92}$Co$_{0.08})_2$As$_{2}$ and Ba(Fe$_{0.95}$Ni$_{0.05})_2$As$_{2}$ single crystals is measured in a wide spectral range. Upon entering the superconducting regime, the reflectivity in both compounds increases considerably at low frequency, leading to a clear gap in the optical conductivity below 100 cm$^{-1}$. From the analysis of the complex conductivity spectra we obtain the penetration depth $lambda(T)=(3500pm 350)$ AA for Ba(Fe$_{0.92}$Co$_{0.08})_2$As$_{2}$ and $(3000pm 300)$ AA for Ba(Fe$_{0.95}$Ni$_{0.05})_2$As$_{2}$. The calculated superfluid density $rho_s$ of both compounds nicely fits the scaling relation $rho_s=(125pm 25)sigma_{dc}T_c$.