It was because the metadata was trying to reach the url using the hostname and the hostname could not be resolved in SP server.
After addng the hostname to hosts file, I was able to connect to the service.
Marked As Answer byDeniz IntepeWednesday, February 15, 2012 9:22 AM
Microsoft is conducting an online survey to understand your opinion of the Technet Web site. If you choose to participate, the online survey will be presented to you when you leave the Technet Web site.