Hi folks I have developed an app for the iPhone / iPad. This app makes regular SOAP calls to retrieve data. I'm having serious issues with this part of the app at the moment.
To get data i've used the standard SOAP method to connect to the server, using NSURLConnection & NSMutableURLRequest. I've implemented the usual delegates ...
- (void) connection: (NSURLConnection *) connection didReceiveResponse: (NSURLResponse *) response
{
}
- (void) connection: (NSURLConnection *) connection didReceiveData: (NSData *) data
{
}
- (void) connection: (NSURLConnection *) connection didFailWithError: (NSError *) error
{
}
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
}
This all works nicely ... most of the time. However if the app goes into sleep mode and I initiate one of these soap calls, I will occasionally (but too often for clients) get one of two errors returned. These are...
Error Domain=NSURLErrorDomainCode=-1005"The network connection was lost." OR Error Domain=NSURLErrorDomainCode=-1001"The request timed out."
This is driving me NUTS!!!
If I initiate an immediate refresh (calls the EXACT same code), the call then does succeed. So basically it appears that the sleep mode is messing with the Wireless connection whereby the first SOAP call after the sleep fails.
Has any one seen this? Is there a resolution? I've coded using 4.3 SDK on a MacBook with Snow Leopard.
Really appreciate any feedback on this. I've spent days on this one.
Derek.