Knowing her name is best. Ma'am and Miss are satisfactory. Avoid Babe.
Those are the primary results of a highly unscientific study I conducted over the last month or so, a man in a restaurant curious about how to address a female server. Contacting men is a lot easier because Sir covers just about everyone.
In truth, unless there is an unexpected need, like dropping a fork, there should be no reason to contact a server of either gender, and the need should lessen as the price point rises. A good server should be alert, and should check his/her tables frequently with just a quick glance, or by reacting to eye contact when necessary.
Actually, the Ma'am/Miss question affects both sides of the server/servee relationship; who calls whom what is primarily a question of paying attention and reading body language. I know mature women who become furious when a server, especially a young woman, addresses them as "young lady."
An introduction by name is often a good idea, but pitfalls loom.
I have a friend with whom we sometimes dine, and he is a friendly type who often asks a server's name. That can create a problem, too, because when the server responds, "George," my friend often gives his name, and while I'm informal, I don't care for a server addressing me by my first name. Anyway, on the evening in question, an extremely quiet night that presaged the imminent closing, the server got friendlier and friendlier, to the point that during the dessert course, he pulled up a chair from an empty table nearby and sat down so that he could continue the conversation.