You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Uwe Geisert (Jira)" <ji...@apache.org> on 2019/10/10 09:29:00 UTC

[jira] [Commented] (OLINGO-1187) Metadata Parser is unable to parse 2 schemas

    [ https://issues.apache.org/jira/browse/OLINGO-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16948347#comment-16948347 ] 

Uwe Geisert commented on OLINGO-1187:
-------------------------------------

Hi,
I have the same issue and can provide a valid schema (from successfactors):
{code:xml}
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="1.0"
	xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<edmx:DataServices m:DataServiceVersion="2.0"
		xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
		<Schema Namespace="SFODataSet"
			xmlns="http://schemas.microsoft.com/ado/2008/09/edm"
			xmlns:sf="http://www.successfactors.com/edm/sf"
			xmlns:sap="http://www.successfactors.com/edm/sap">
			<EntityContainer Name="EntityContainer" m:IsDefaultEntityContainer="true">
				<EntitySet Name="PerPerson" EntityType="SFOData.PerPerson" sap:label="Biographical Information" sap:creatable="false" sap:updatable="false" sap:upsertable="true" sap:deletable="false">
					<Documentation>
						<Summary>PerPerson</Summary>
						<LongDescription>This entity contains the non-effective-dated biographical information such as date of birth, country of birth. It is commonly used as the main entity when doing employee master extracts.</LongDescription>
						<sap:tagcollection>
							<sap:tag>Employee Central (EC)</sap:tag>
							<sap:tag>EC - Personal Information</sap:tag>
							<sap:tag>Recommended</sap:tag>
						</sap:tagcollection>
					</Documentation>
				</EntitySet>
			</EntityContainer>
		</Schema>
		<Schema Namespace="SFOData"
			xmlns="http://schemas.microsoft.com/ado/2008/09/edm"
			xmlns:sf="http://www.successfactors.com/edm/sf"
			xmlns:sap="http://www.successfactors.com/edm/sap">
			<EntityType Name="PerPerson">
				<Key>
					<PropertyRef Name="personIdExternal"></PropertyRef>
				</Key>
				<Property Name="birthName" Type="Edm.String" Nullable="true" sap:required="false" sap:creatable="false" sap:updatable="false" sap:upsertable="true" sap:visible="true" sap:sortable="false" sap:filterable="false" MaxLength="128" sap:label="Birth Name"></Property>
				<Property Name="countryOfBirth" Type="Edm.String" Nullable="true" sap:required="true" sap:creatable="false" sap:updatable="false" sap:upsertable="true" sap:visible="true" sap:sortable="true" sap:filterable="true" MaxLength="100" sap:label="Country of Birth"></Property>
				<Property Name="createdBy" Type="Edm.String" Nullable="true" sap:required="false" sap:creatable="false" sap:updatable="false" sap:upsertable="false" sap:visible="true" sap:sortable="true" sap:filterable="true" MaxLength="100" sap:label="Created By"></Property>
				<Property Name="createdDateTime" Type="Edm.DateTimeOffset" Nullable="true" sap:required="false" sap:creatable="false" sap:updatable="false" sap:upsertable="false" sap:visible="true" sap:sortable="true" sap:filterable="true" sap:label="Created Date Time"></Property>
				<Property Name="createdOn" Type="Edm.DateTime" Nullable="true" sap:required="false" sap:creatable="false" sap:updatable="false" sap:upsertable="false" sap:visible="true" sap:sortable="true" sap:filterable="true" sap:display-format="Date" sap:label="Created On"></Property>
				<Property Name="dateOfBirth" Type="Edm.DateTime" Nullable="true" sap:required="true" sap:creatable="false" sap:updatable="false" sap:upsertable="true" sap:visible="true" sap:sortable="true" sap:filterable="true" sap:display-format="Date" sap:label="Date of Birth"></Property>
				<Property Name="includeAllRecords" Type="Edm.Boolean" Nullable="true" sap:required="false" sap:creatable="false" sap:updatable="false" sap:upsertable="false" sap:visible="false" sap:sortable="false" sap:filterable="true" sap:label="Include All Records"></Property>
				<Property Name="lastModifiedBy" Type="Edm.String" Nullable="true" sap:required="false" sap:creatable="false" sap:updatable="false" sap:upsertable="false" sap:visible="true" sap:sortable="true" sap:filterable="true" MaxLength="100" sap:label="Last Modified By"></Property>
				<Property Name="lastModifiedDateTime" Type="Edm.DateTimeOffset" Nullable="true" sap:required="false" sap:creatable="false" sap:updatable="false" sap:upsertable="false" sap:visible="true" sap:sortable="true" sap:filterable="true" sap:label="Last Modified Date Time"></Property>
				<Property Name="lastModifiedOn" Type="Edm.DateTime" Nullable="true" sap:required="false" sap:creatable="false" sap:updatable="false" sap:upsertable="false" sap:visible="true" sap:sortable="true" sap:filterable="true" sap:display-format="Date" sap:label="Last Modified On"></Property>
				<Property Name="perPersonUuid" Type="Edm.String" Nullable="true" sap:required="false" sap:creatable="false" sap:updatable="false" sap:upsertable="false" sap:visible="true" sap:sortable="true" sap:filterable="true" MaxLength="32" sap:label="perPersonUuid"></Property>
				<Property Name="personId" Type="Edm.Int64" Nullable="true" sap:required="false" sap:creatable="false" sap:updatable="false" sap:upsertable="false" sap:visible="true" sap:sortable="true" sap:filterable="true" sap:label="personId"></Property>
				<Property Name="personIdExternal" Type="Edm.String" Nullable="false" sap:required="true" sap:creatable="false" sap:updatable="false" sap:upsertable="true" sap:visible="true" sap:sortable="true" sap:filterable="true" MaxLength="32" sap:label="Person ID"></Property>
				<Property Name="userId" Type="Edm.String" Nullable="true" sap:required="false" sap:creatable="false" sap:updatable="false" sap:upsertable="true" sap:visible="false" sap:sortable="false" sap:filterable="false" MaxLength="100" sap:label="User Id"></Property>
			</EntityType>
		</Schema>
	</edmx:DataServices>
</edmx:Edmx>
{code}



> Metadata Parser is unable to parse 2 schemas
> --------------------------------------------
>
>                 Key: OLINGO-1187
>                 URL: https://issues.apache.org/jira/browse/OLINGO-1187
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata4-client
>    Affects Versions: (Java) V4 4.4.0
>            Reporter: chenggong li
>            Priority: Major
>
> metadata.xml like following:
> {code}
> <?xml version='1.0' encoding='utf-8'?>
> <edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
>     <edmx:DataServices m:DataServiceVersion="3.0">
>         <Schema xmlns="http://schemas.microsoft.com/ado/2008/09/edm" Namespace="EntitisModel">
>         </Schema>
>         <Schema xmlns="http://schemas.microsoft.com/ado/2008/09/edm" Namespace="EntitiesNameSpace">
>         </Schema>
>     </edmx:DataServices>
> </edmx:Edmx>
> {code}
> My code like:
> {code}
> XMLMetadata metadata = client.getDeserializer(ContentType.APPLICATION_XML).toMetadata(content);
> Map<String, CsdlSchema> xmlSchemas = metadata.getSchemaByNsOrAlias();
> Edm edm = client.getReader().readMetadata(xmlSchemas);
> List<EdmSchema> schemas = edm.getSchemas();
> for (EdmSchema schema : schemas) {
>     String namespace = schema.getNamespace();
>     LOGGER.debug("schema.namespace '" + namespace + "' ");
> }
> {code}
> Output:
> {code}
> DEBUG c.s.s.s.ODataReader - schema.namespace 'EntitisModel' 
> {code}
> We got "schema.namespace 'EntitisModel'" only, no "schema.namespace 'EntitiesNameSpace'"



--
This message was sent by Atlassian Jira
(v8.3.4#803005)