I have actually had the pleasure of going to both places.
When I was in Shanghai it was still in the twilight of development so I don't know much about it today.
I did live in China most of my life, I was even born there (Hong Kong), so I am more partial to the culture.
But I would have to say Shanghai because it is a huge culture hub in South China and is a location filled with so much history.
Dubai, was the only nice city in the Middle East besides Jeddah. They were more lenient law wise, unlike neighboring Saudi Arabia. But the Middle East is the earth's "ghetto" and nothing exceptionally good come from the area, only oil and angry immigrants (which isn't exceptional).