You can say "What are you?" to enquire about profession, although other methods would probably be preferred.