Modeling gas-phase H2O between 5 μm and 540 μm toward massive protostars