0
votes

I'm working on iOS App which loads data using SOAP Requests. All things are working properly in iOS 9 or earlier. I have updated xcode and running app and getting below error while fetching data using simple "GET" method.

ERROR: The ERROR : Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." UserInfo={NSErrorFailingURLStringKey=http://xyz.com.au/webservice/xyz.php, _kCFStreamErrorCodeKey=57, NSErrorFailingURLKey=http://xyz.com.au/webservice/xyz.php, NSLocalizedDescription=The network connection was lost., _kCFStreamErrorDomainKey=1, NSUnderlyingError=0x14d7dff0 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 "The network connection was lost." UserInfo={_kCFStreamErrorCodeKey=57, NSErrorPeerAddressKey={length = 16, capacity = 16, bytes = 0x10020050325790c40000000000000000}, NSErrorFailingURLKey=http://xyz.com.au/webservice/xyz.php, NSErrorFailingURLStringKey=http://xyz.com.au/webservice/xyz.php, _kCFStreamErrorDomainKey=1, NSLocalizedDescription=The network connection was lost.}}}

I'm using NSURLConnection standard code for calling WS.

Please help in critical issue.

Thanks in advance.

4

4 Answers

0
votes

Try following solution.

1) Restarting the simulator fixed the issue for me.

2) For mine, Resetting content and settings of Simulator works.

3) Increase KeepAliveTimeout time for request.

4) Make sure about your request parameter.

0
votes

Use NSURLSession instead of NSURLConnection.

0
votes

Same error here with some parameters sent by POST method, and pdf file as response. Same code was perfectly running on iOS<10

No solution found yet but for me the problem occurs only when the request is sent through a VPN or a proxy server. Is it the same for you?

0
votes

to Shiner I have same trouble. In browsers on Ipad (ios 10). Ipad connected over VPN. If try open any page with long response time( > 2 min), then connection losted. In console "Failed to load resorce: The request timed out"