on 2021 Sep 01 8:01 AM
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
Below is the error.
-----------------------------------------
Fatal error: 'try!' expression unexpectedly raised an error: UnexpectedException; Caused by: AssertException: Unrecoverable CSDL parsing failure!
The original metadata has an Edmx:Reference that looks like this:
<edmx:Reference Uri="https://my300942-api.s4hana.ondemand.com/sap/opu/odata/iwfnd/catalogservice;v=2/Vocabularies(TechnicalName='%2FIWBEP%2FVOC_CAPABILITIES',Version='0001',SAP__Origin='LOCAL')/$value" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
<edmx:Include Namespace="Org.OData.Capabilities.V1" Alias="Capabilities"/>
<edmx:Include Namespace="Org.OData.Capabilities.V1"/>
</edmx:Reference>
If you can get the server team responsible to remove the duplicate edmx:Include I think the error may go away.
Best to open an incident so that the Assistant can be fixed to report any such errors at proxy generation time rather than at run time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Maybe you can use the "Insert File" button (looks like paper clip) to insert the complete contents of the CdsApiHandlingUnitEntitiesMetadataText.swift here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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\" ................
User | Count |
---|---|
67 | |
10 | |
10 | |
10 | |
7 | |
7 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.