微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用 cloud-sdk maven 配置文件生成 VDM 时遇到错误

如何解决使用 cloud-sdk maven 配置文件生成 VDM 时遇到错误

我正在尝试使用以下元数据生成 VDM-

<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="1.0"
    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">
    <edmx:DataServices m:DataServiceVersion="2.0">
        <Schema Namespace="myService" xml:lang="en" sap:schema-version="1" xmlns="http://schemas.microsoft.com/ado/2008/09/edm">
            <Annotation Term="Core.SchemaVersion" String="1.0.0" xmlns="http://docs.oasis-open.org/odata/ns/edm"/>
            <EntityType Name="myPlant" sap:content-version="1">
                <Key>
                    <PropertyRef Name="Plant"/>
                    <PropertyRef Name="PlantName"/>
                </Key>
                <Property Name="Plant" Type="Edm.String" Nullable="false" MaxLength="4" sap:unicode="false" sap:label="Plant" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
                <Property Name="PlantName" Type="Edm.String" Nullable="false" MaxLength="30" sap:unicode="false" sap:label="PurchasinPlant" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
                <Property Name="ValuationArea" Type="Edm.String" Nullable="false" MaxLength="4" sap:unicode="false" sap:label="Valuation Area" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
                <Property Name="PlantCustomer" Type="Edm.String" Nullable="false" MaxLength="10" sap:unicode="false" sap:label="Customernoplant" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
                <Property Name="Plantsupplier" Type="Edm.String" Nullable="false" MaxLength="10" sap:unicode="false" sap:label="Sppl. No. Plnt" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
                <Property Name="DefaultPurchasingOrganization" Type="Edm.String" Nullable="false" MaxLength="4" sap:unicode="false" sap:label="Purchasing Org." sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
                <Property Name="FactoryCalendar" Type="Edm.String" Nullable="false" MaxLength="2" sap:unicode="false" sap:label="Factory Calend." sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
                <Property Name="SalesOrganization" Type="Edm.String" Nullable="false" MaxLength="4" sap:unicode="false" sap:label="Sales Org. ICB" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
                <Property Name="AddressId" Type="Edm.String" Nullable="false" MaxLength="10" sap:unicode="false" sap:label="Address" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
                <Property Name="PlantCategory" Type="Edm.String" Nullable="false" MaxLength="1" sap:unicode="false" sap:label="Plant cat." sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
                <Property Name="distributionchannel" Type="Edm.String" Nullable="false" MaxLength="2" sap:unicode="false" sap:label="distrib.channel" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/>
            </EntityType>
            
            
            <EntityContainer Name="myService_Entities" m:IsDefaultEntityContainer="true" sap:supported-formats="atom json xlsx">
                <EntitySet Name="myPlantSet" EntityType="myService.myPlant" sap:creatable="false" sap:updatable="false" sap:deletable="false" sap:pageable="false" sap:content-version="1"/>
            </EntityContainer>
            <atom:link rel="self" href="https://sap/myService/$Metadata" xmlns:atom="http://www.w3.org/2005/Atom"/>
            <atom:link rel="latest-version" href="https://sap/myService/$Metadata" xmlns:atom="http://www.w3.org/2005/Atom"/>
        </Schema>
    </edmx:DataServices>
</edmx:Edmx>

在运行 maven 配置文件时,出现以下错误-

错误:URI=file:/C:../src/main/resources/connectedsystem/Metadata/myService.xml Line=5:文档根元素“edmx:Edmx”,必须匹配 DOCTYPE 根“null”。 错误:URI=file:/C:../src/main/resources/connectedsystem/Metadata/myService.xml Line=5:文档无效:未找到语法。 警告:验证已打开,但未设置 org.xml.sax.ErrorHandler,这可能不是我们想要的。解析器将使用认的 ErrorHandler 打印前 0 个错误。请调用 setErrorHandler 方法解决这个问题。 错误:URI=file:/C:../src/main/resources/connectedsystem/Metadata/myService.xml Line=5:文档根元素“edmx:Edmx”,必须匹配 DOCTYPE 根“null”。 错误:URI=file:/C:../src/main/resources/connectedsystem/Metadata/myService.xml Line=5:文档无效:未找到语法。

使用的cloud-sdk版本是3.42.0

解决方法

出现这些错误消息的原因通常是 XML 文档根据 XML 标准无效。但是,在大多数情况下,这不会危及代码生成。所以请告诉我们代码生成是否也失败。

我可以使用提供的元数据成功生成代码,因此我相信没有问题。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。