[ 
https://issues.apache.org/jira/browse/OLINGO-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

chenggong li updated OLINGO-1187:
---------------------------------
    Description: 
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();
                // edm.get
                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'"

  was:
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>
{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();
                // edm.get
                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'"


> 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
>
> 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();
>               // edm.get
>               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
(v6.4.14#64029)

Reply via email to