Hi guys,
I was able to connect a external resource from a sap system to my cap app.
Unfortunately I receive the following error: 'An error occurred during serialization of the entity collection.'
In the Inspector I received a more detailed Error Message: 'An error occurred during serialization of the entity collection. An error occurred during serialization of the entity at index #0 in the entity collection. The key 'SAP_UUID' does not exist in the given entity.'
Is the error a result of the difference between OData v2 and v4?
Is there a best practice to resolve the error?
Cheers,
Thorsten
<edmx:Edmx xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:sap="http://www.sap.com/Protocols/SAPData" Version="1.0"> <edmx:Reference xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Uri="http://url+port/sap/opu/odata/IWFND/CATALOGSERVICE;v=2/Vocabularies(TechnicalName='%2FIWBEP%2FVOC_COMMON',Version='0001',SAP__Origin='LOCAL')/$value"> <edmx:Include Namespace="com.sap.vocabularies.Common.v1" Alias="Common"/> </edmx:Reference> <edmx:Reference xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Uri="http://url+port/sap/opu/odata/IWFND/CATALOGSERVICE;v=2/Vocabularies(TechnicalName='%2FIWBEP%2FVOC_CAPABILITIES',Version='0001',SAP__Origin='LOCAL')/$value"> <edmx:Include Namespace="Org.OData.Capabilities.V1" Alias="Capabilities"/> </edmx:Reference> <edmx:Reference xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Uri="http://url+port/sap/opu/odata/IWFND/CATALOGSERVICE;v=2/Vocabularies(TechnicalName='%2FIWBEP%2FVOC_COMMUNICATION',Version='0001',SAP__Origin='LOCAL')/$value"> <edmx:Include Namespace="com.sap.vocabularies.Communication.v1" Alias="Communication"/> </edmx:Reference> <edmx:Reference xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Uri="http://url+port/sap/opu/odata/IWFND/CATALOGSERVICE;v=2/Vocabularies(TechnicalName='%2FIWBEP%2FVOC_AGGREGATION',Version='0001',SAP__Origin='LOCAL')/$value"> <edmx:Include Namespace="Org.OData.Aggregation.V1" Alias="Aggregation"/> </edmx:Reference> <edmx:Reference xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Uri="http://url+port/sap/opu/odata/IWFND/CATALOGSERVICE;v=2/Vocabularies(TechnicalName='%2FIWBEP%2FVOC_PERSONALDATA',Version='0001',SAP__Origin='LOCAL')/$value"> <edmx:Include Namespace="com.sap.vocabularies.PersonalData.v1" Alias="PersonalData"/> </edmx:Reference> <edmx:DataServices m:DataServiceVersion="2.0"> <Schema xmlns="http://schemas.microsoft.com/ado/2008/09/edm" Namespace="xJSSxTBUSINESSOBJECT_CDS" xml:lang="en" sap:schema-version="1"> <EntityType Name="xJSSxTBUSINESSOBJECTType" sap:label="TBusinessObject" sap:content-version="1"> <Key> <PropertyRef Name="SAP_UUID"/> </Key> <Property Name="SAP_UUID" Type="Edm.Guid" Nullable="false" sap:label="UUID" sap:quickinfo="16 Byte UUID in 16 Bytes (Raw Format)"/> <Property Name="LastName" Type="Edm.String" MaxLength="20" sap:label="LastName"/> <Property Name="FirstName" Type="Edm.String" MaxLength="20" sap:label="FirstName"/> <Property Name="Age" Type="Edm.String" MaxLength="20" sap:label="Age"/> <Property Name="Birthday" Type="Edm.String" MaxLength="20" sap:label="Birthday"/> <Property Name="ID" Type="Edm.String" MaxLength="10" sap:display-format="NonNegative" sap:label="ID"/> <Property Name="SAP_Description" Type="Edm.String" MaxLength="80" sap:label="Description"/> </EntityType> <EntityContainer Name="xJSSxTBUSINESSOBJECT_CDS_Entities" m:IsDefaultEntityContainer="true" sap:message-scope-supported="true" sap:supported-formats="atom json xlsx"> <EntitySet Name="xJSSxTBUSINESSOBJECT" EntityType="xJSSxTBUSINESSOBJECT_CDS.xJSSxTBUSINESSOBJECTType" sap:searchable="true" sap:content-version="1"/> <FunctionImport Name="xJSSxTBUSINESSOBJECTSap_upsert" ReturnType="xJSSxTBUSINESSOBJECT_CDS.xJSSxTBUSINESSOBJECTType" EntitySet="xJSSxTBUSINESSOBJECT" m:HttpMethod="POST"> <Parameter Name="LastName" Type="Edm.String" Mode="In" MaxLength="20"/> <Parameter Name="FirstName" Type="Edm.String" Mode="In" MaxLength="20"/> <Parameter Name="Age" Type="Edm.String" Mode="In" MaxLength="20"/> <Parameter Name="Birthday" Type="Edm.String" Mode="In" MaxLength="20"/> <Parameter Name="ID" Type="Edm.String" Mode="In" MaxLength="10"/> <Parameter Name="SAP_Description" Type="Edm.String" Mode="In" MaxLength="80"/> </FunctionImport> </EntityContainer> <Annotations xmlns="http://docs.oasis-open.org/odata/ns/edm" Target="xJSSxTBUSINESSOBJECT_CDS.xJSSxTBUSINESSOBJECT_CDS_Entities"> <Annotation Term="Aggregation.ApplySupported"> <Record> <PropertyValue Property="Transformations"> <Collection> <String>aggregate</String> <String>groupby</String> <String>filter</String> </Collection> </PropertyValue> <PropertyValue Property="Rollup" EnumMember="None"/> </Record> </Annotation> </Annotations> <Annotations xmlns="http://docs.oasis-open.org/odata/ns/edm" Target="xJSSxTBUSINESSOBJECT_CDS.xJSSxTBUSINESSOBJECTType/ID"> <Annotation Term="Common.FieldControl" EnumMember="Common.FieldControlType/Mandatory"/> </Annotations> <Annotations xmlns="http://docs.oasis-open.org/odata/ns/edm" Target="xJSSxTBUSINESSOBJECT_CDS.xJSSxTBUSINESSOBJECTType"> <Annotation Term="Common.SemanticKey"> <Collection> <PropertyPath>ID</PropertyPath> </Collection> </Annotation> </Annotations> <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="self" href="http://qebui.js-soft.local:8000/sap/opu/odata/JSS/TBUSINESSOBJECT_CDS/$metadata"/> <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="latest-version" href="http://qebui.js-soft.local:8000/sap/opu/odata/JSS/TBUSINESSOBJECT_CDS/$metadata"/> </Schema> </edmx:DataServices> </edmx:Edmx>