I created sample app using SAP Cloud platform, it also generated Proxy classes with backend url "http://staging.*****.com/OData/sapiOS.svc/". When I running the app it didn't display the details and shows an error: " JsonError: Expected token start character, found '<'." JsonError.
Asked
Active
Viewed 448 times
-1

Boghyon Hoffmann
- 17,103
- 12
- 72
- 170

BIJU C
- 21
- 5
-
Check that the responds is really JSON? Did you show yourself that error alert? – Larme Aug 03 '17 at 08:55
-
I response is in XML. I can get by call normal API call. In here I used SAP iOS SDK for the APIs. SAP oData Services. – BIJU C Aug 03 '17 at 09:47
-
I don't understand: Response is in `XML`, and the error states about `JSON` Then the error message is quite clear, it saw a answer starting with "<" (as an XML would do), and not a `[` or a `{` as a JSON would do. Why using a JSON parser for a XML response? – Larme Aug 03 '17 at 09:49
-
I didn't use any parser. it's parsing by SAP Sdk. The error return by SAP sdk. Please look this url about sap: [link](https://www.sap.com/developer/tutorials/hcp-webide-odata-primer.html) – BIJU C Aug 03 '17 at 09:57
-
I'm not familiar with SAP SDK, and I don't know what you are doing exactly, but there is clearly a mismatch between XML and JSON, I don't know if you are sending XML while you should sending JSON or receiving XML while you should be receiving JSON. – Larme Aug 03 '17 at 09:59
-
Please see this to know about SAP Sdk https://www.sap.com/developer/topics/cloud-platform-sdk-for-ios.html – BIJU C Aug 03 '17 at 10:12
1 Answers
0
You can ignore all app transport security restrictions with a single key add these to the Info.plist open as Source Code:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>

Emre Ozdil
- 401
- 6
- 12