You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Andrey Uspenskiy (Jira)" <ji...@apache.org> on 2019/11/22 14:21: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=16980187#comment-16980187 ]
Andrey Uspenskiy commented on OLINGO-1187:
------------------------------------------
Hi, I have the same issue with metadata parser. i only get the first schema
{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">
</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">
</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)