I am a foreign student learning Chinese in Beijing, China. I had previous Chinese language coursework before going to China. When I try to speak Chinese to people on the street in Beijing, they say, "I don't understand you", and ignore me. I know I have an accent, but I am still comprehensible. They don't even bother to listen to what I'm saying just because I have an accent.
I visited Shanghai, and the people were different. They were not like the Beijing people, and they were willing to speak Chinese with foreigners. This difference in attitude is probably because of the two cities' different historical experiences with Europeans.