Iphone – Problem with xml web service n iphone apps

iphonexml

I am doing one social networking apps and i have to get data from server using xml web service I have few web services which gives me data from server.

I have very strange problem like some times web services are not returning any data and if paste in browser same web services gives result in browser but they will not return in iphone apps. And sometimes it gives me data with same code.

How can i know that where is the problem. Web services also working on browser but not working on iphone apps. Because it works for some time and not working for some time with same code.

Does anyone have any idea or how can i debug my web service that they have any problem or not?.

Thanks

Best Answer

If you're using NSURLConnection then implement the delegate:

- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error

This will tell you if there are any problems with the call. It could be that on the desktop you're getting a stable internet connection but on the phone your connection might be intermittent.