Harnesses need to be replaced when worn. Other than wear, I don't know if they would have an expiration date since they don't have any dynamic properties.
Also, are you speaking of rock climbing, glacier travel or what? A static rope used for glacier travel is going to last a lot longer than a rope used for rock climbing, expecially an un-used static line vs an un-used dynamic.
Climbing ropes, even if not used loose their dynamic properties over time. I've heard 5-7 years for a rope that's never been used, but it's not gospel. If the rope is used and has taken falls, the time is much reduced. I know sport climbers who replace threir ropes every six months. Ropes do have fall ratings as well, so you have to take in account how many falls and hard falls your rope has taken.