Using a W Beam on its Side
A “W Shape” steel beam is the wrong shape. It’s nearly as wide as tall.
I’d try a “S Shape” steel beam. They are “skinny” and can be installed in the wall correctly (vertically).
Give us an idea of the load and we can give a size. (A S8 will support about 14 kips for a 16’ span and has a flange width of 4”.)