0

I am getting this error when validating my schema Below I have attached both xsds. Error comes from subservice.xsd.

src-resolve: Cannot resolve the name 'ns0:PublishHeaderType' to a(n) 'type definition' component.

subservice.xsd

<?xml version="1.0" encoding="UTF-8"?>

<xsd:schema xmlns="http://www.example.com/capmkts/structuredtrading/issuance/dataservice/v3.x"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     xmlns:sec="http://www.example.com/enterprisedata/eldm/integrated/security/v5.x"
     xmlns:srvtypes="http://www.example.com/enterprisedata/core/serviceTypes/v1.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:ns0="http://www.example.com/enterprisedata/core/serviceTypes/v1.0"
     targetNamespace="http://www.example.com/capmkts/structuredtrading/issuance/dataservice/v3.x"
     elementFormDefault="qualified"
     attributeFormDefault="unqualified">
    <xsd:import namespace="http://www.example.com/enterprisedata/eldm/integrated/security/v5.x" schemaLocation="./ELDM_INTGTD_Security.xsd"/>
    <xsd:import namespace="http://www.example.com/enterprisedata/core/serviceTypes/v1.0" schemaLocation="./EDR_ServiceTypes.xsd"/>

    <!-- ###########TOP LEVEL EXPOSED ELEMENTS########################################## -->
    <!--The following elements are exposed for embedding in WSDL and EMS based interface documents-->
    <xsd:element name="SecurityPublishDataSet" type="SecurityPublishDataSetType"/>
    <xsd:element name="StructuredTransactionDealPublishDataSet" type="StructuredTransactionDealPublishDataSetType"/>

    <!-- ##################################################################### -->
    <xsd:complexType name="SecurityPublishDataSetType">
        <xsd:sequence>
            <xsd:element name="PublishHeader" type="ns0:PublishHeaderType"/>
            <xsd:element name="PublishPayload" type="SecurityPayloadType" minOccurs="0"/>
        </xsd:sequence>
        <xsd:attribute name="schemaVersion" type="xsd:string" use="required"/>
    </xsd:complexType>
    <xsd:complexType name="SecurityPayloadType">
        <xsd:choice>
            <xsd:element name="Securities" type="sec:Securities" minOccurs="0"/>
            <xsd:element name="StructuredTransactionDeals" type="sec:StructuredTransactionDeals" minOccurs="0"/>
        </xsd:choice>
    </xsd:complexType>
    <xsd:complexType name="StructuredTransactionDealPublishDataSetType">
        <xsd:sequence>
            <xsd:element name="PublishHeader" type="ns0:PublishHeaderType"/>
            <xsd:element name="PublishPayload" type="StructuredTransactionDealPayloadType" minOccurs="0"/>
        </xsd:sequence>
        <xsd:attribute name="schemaVersion" type="xsd:string" use="required"/>
    </xsd:complexType>
    <xsd:complexType name="StructuredTransactionDealPayloadType">
        <xsd:sequence>
            <xsd:element name="StructuredTransactionDeals" type="sec:StructuredTransactionDeals" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>
</xsd:schema>

EDR_ServiceTypes.xsd

<?xml version="1.0" encoding="UTF-8"?>

<xsd:schema xmlns="http://www.example.com/enterprisedata/core/serviceTypes/v1.0"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     targetNamespace="http://www.example.com/enterprisedata/core/serviceTypes/v1.0"
     elementFormDefault="qualified"
     attributeFormDefault="unqualified">
    <xsd:complexType name="RequestHeaderType">
        <xsd:sequence>
            <xsd:element name="RequestCreationTimestamp" type="xsd:dateTime"/>
            <xsd:element name="RequestPostTimestamp" type="xsd:dateTime" minOccurs="0"/>
            <xsd:element name="RequestID" type="xsd:string"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="ResponseHeaderType">
        <xsd:sequence>
            <xsd:element name="RequestID" type="xsd:string"/>

            <!-- echo back from request -->
            <xsd:element name="RequestCreationTimestamp" type="xsd:dateTime"/>

            <!-- echo back from request -->
            <xsd:element name="RequestReceiptTimestamp" type="xsd:dateTime"/>

            <!-- capture timestamp as soon as received -->
            <xsd:element name="ResponseCreationTimestamp" type="xsd:dateTime" minOccurs="0"/>
            <xsd:element name="ResponsePostTimestamp" type="xsd:dateTime"/>
            <xsd:element name="ResponseCode" type="xsd:int"/>
            <xsd:element name="RecordCount" type="xsd:int" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="PublishHeaderType">
        <xsd:sequence>
            <xsd:element name="PublishTimestamp" type="xsd:dateTime"/>
            <xsd:element name="PublishCode" type="xsd:int" minOccurs="0"/>
            <xsd:element name="PayloadID" type="xsd:string" minOccurs="0"/>
            <xsd:element name="RecordCount" type="xsd:int" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="ErrorDetailType">
        <xsd:sequence>
            <xsd:element name="ExceptionCode" type="xsd:token" minOccurs="0"/>
            <xsd:element name="ExceptionSummary" type="xsd:token" minOccurs="0"/>
            <xsd:element name="ExceptionMessage" type="xsd:token" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element name="ExceptionTrace" type="xsd:token" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>
</xsd:schema>

any idea on the issue? any help would be appreciated.

xmlns:ns0 url is the same on EDR_ServiceTypes.xsd targetNamespace. Not sure what else could be the issue.

NoobCoder
  • 53
  • 4
  • Perhaps this helps: [_How to solve this error : src-resolve: Cannot resolve the name 'j2ee:descriptionType' to a(n) 'type definition' component.?_](https://stackoverflow.com/a/9945668/1744774) – Gerold Broser Jun 07 '23 at 04:21

0 Answers0