Many textbooks says " Onamae wa nan desuka " as " What's your name ? ".
It's grammatically correct, but actually it's a bit rude.
I will explain why it is bad and introduce other expressions.
Additional imformation : Here's a short summary of " ・・・・・wa ・・・・desuka" expression.