cancel
Showing results for 
Search instead for 
Did you mean: 

SAP BTP IOS - Unrecoverable CSDL parsing failure!​

Sasikirank
Explorer
0 Kudos
299

Hello,

My project has included below destination and i need to work on it but the internal metadata parser class fails to convert the xml to csdl document.

static func parse() -> CSDLDocument {

let parser = CSDLParser()

parser.logWarnings = false

parser.csdlOptions = CdsApiHandlingUnitEntitiesMetadataParser.options

parser.csdlFetcher = CdsApiHandlingUnitEntitiesMetadataParser.fetcher

let metadata = parser.parseInProxy(CdsApiHandlingUnitEntitiesMetadataText.xml, url: "cds_api_handling_unit") // crashing

metadata.proxyVersion = "21.7.2"

return metadata

}metadata.txt

Below is the error.

-----------------------------------------

Fatal error: 'try!' expression unexpectedly raised an error: UnexpectedException; Caused by: AssertException: Unrecoverable CSDL parsing failure!

View Entire Topic
evanireland
Product and Topic Expert
Product and Topic Expert
0 Kudos

It would be expected for the xml string to start with a "<" character, rather than " \n".

Perhaps if we could see the original metadata document it would help.

Were the proxies generated by the Assistant or by the sapcpsdk-proxygenerator?

Sasikirank
Explorer
0 Kudos

Proxy classes were generated by Assistant.Out of 10 other destinations only this one is creating issue and making the app crashes.

I dont know why the string was changed after pasting here.

Actual Metadata string is starting correctly

"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<?xmlc base=\"36\"?>\n<?xmlc-define _0=\"Name\" _1=\"Type\" _2=\"Property\" _3=\"sap:label\" _4=\"MaxLength\" _5=\"sap:quickinfo\" _6=\"sap:display-format\" _7=\"edmx:Reference\" _8=\"Precision\" _9=\"Scale\" _A=\"Namespace\" _B=\"edmx:Include\" _C=\"sap:unit\" _D=\"xmlns:edmx\" _E=\"Alias\" _F=\"Role\" _G=\"Uri\" _<_2 _0=\"StorageType\" _1=\"$0\" _4=\"$8\" _6=\"$2\" _3=\"Storage Type\"/><_2 _0=\"StorageSection\" _1=\"$0\" _4=\"$8\" _6=\"$2\" _3=\"Storage Section\"/><_2 _0=\"StorageBin\" _1=\"$0\" _4=\"$M\" _6=\"$2\" _3=\"Storage Bin\"/><_13 _0=\"to_HandlingUnitItem\" ................