﻿<?xml version="1.0" encoding="utf-8" ?>
<schema xmlns:tns="https://webservices.sanctieplatform.nl/organisation/" elementFormDefault="qualified" targetNamespace="https://webservices.sanctieplatform.nl/organisation/" xmlns="http://www.w3.org/2001/XMLSchema">
    <group name="OnBehalfUserGroup">
        <annotation>
            <documentation>
                The employee the operation acts for. Specify either OnBehalfUserId or
                OnBehalfUserEmail, not both. One of the two is mandatory; because a schema cannot
                express that, the service enforces it and rejects a request that gives both or
                neither with INVALID_REQUEST.
            </documentation>
        </annotation>
        <sequence>
            <element name="OnBehalfUserId" minOccurs="0" maxOccurs="1" nillable="false">
                <annotation>
                    <documentation>
                        Specify either OnBehalfUserId or OnBehalfUserEmail, not both. One of the two is mandatory.
                        See Reference.GetAllUsersInOwnOrganisation and use users with IsActive = TRUE.
                    </documentation>
                </annotation>
                <simpleType>
                    <restriction base="int">
                        <minInclusive value="1" />
                    </restriction>
                </simpleType>
            </element>
            <element name="OnBehalfUserEmail" minOccurs="0" maxOccurs="1" nillable="false">
                <annotation>
                    <documentation>
                        Specify either OnBehalfUserId or OnBehalfUserEmail, not both. One of the two is mandatory.
                        E-mail address of the user, e.g. name@provider.nl. Unique in the system.
                    </documentation>
                </annotation>
                <simpleType>
                    <restriction base="string">
                        <whiteSpace value="collapse" />
                        <maxLength value="250" />
                        <minLength value="5" />
                        <pattern value="[_\-a-zA-Z0-9\.\+]+@[a-zA-Z0-9](\.?[\-a-zA-Z0-9]*[a-zA-Z0-9])*" />
                    </restriction>
                </simpleType>
            </element>
        </sequence>
    </group>

	<simpleType name="OrganisationOrderDirection">
        <restriction base="string">
            <enumeration value="Ascending" />
            <enumeration value="Descending" />
        </restriction>
    </simpleType>
    <complexType name="CreateOrganisationResponseType">
        <sequence minOccurs="1" maxOccurs="1">
            <element name="Id" type="int" minOccurs="1" maxOccurs="1">
                <annotation>
                    <documentation>
                        Unique technical id of the organisation.
                        Can be used to call the Organisation.GetOrganisationById operation
                    </documentation>
                </annotation>
            </element>
            <element name="CreatedByUserId" minOccurs="1" maxOccurs="1">
                <annotation>
                    <documentation>See operation Reference.GetUserById</documentation>
                </annotation>
                <simpleType>
                    <restriction base="int">
                        <minInclusive value="1" />
                    </restriction>
                </simpleType>
            </element>
            <element name="CreatedOnAt" type="dateTime" minOccurs="1" maxOccurs="1" />
        </sequence>
    </complexType>
    <complexType name="DocumentDownloadsType">
        <sequence minOccurs="1" maxOccurs="1">
            <element name="Document" type="tns:DocumentDownloadType" minOccurs="0" maxOccurs="unbounded" />
        </sequence>
    </complexType>
    <complexType name="DocumentDownloadType">
        <sequence minOccurs="1" maxOccurs="1">
            <element name="DocumentId" minOccurs="1" maxOccurs="1">
                <annotation>
                    <documentation>The technical id of the document to download.</documentation>
                </annotation>
                <simpleType>
                    <restriction base="int">
                        <minInclusive value="1" />
                    </restriction>
                </simpleType>
            </element>
            <element name="FileName" minOccurs="1" maxOccurs="1">
                <annotation>
                    <documentation>The complete file name (as shown in link GUI).</documentation>
                </annotation>
                <simpleType>
                    <restriction base="string">
                        <minLength value="1" />
                        <maxLength value="255" />
                    </restriction>
                </simpleType>
            </element>
            <element name="DocumentType" minOccurs="1" maxOccurs="1">
                <annotation>
                    <documentation>
                        NOTE: When attaching a DocumenTypeId that DocumentType has to be IsSelectable = true!
                        see Reference.GetAllDocumentTypes
                    </documentation>
                </annotation>
                <simpleType>
                    <restriction base="int">
                        <minInclusive value="1" />
                    </restriction>
                </simpleType>
            </element>
            <element name="UserId" minOccurs="1" maxOccurs="1">
                <annotation>
                    <documentation>The id of the user who uploaded the document</documentation>
                </annotation>
                <simpleType>
                    <restriction base="int">
                        <minInclusive value="1" />
                    </restriction>
                </simpleType>
            </element>
            <element name="UploadedOnAt" type="dateTime" minOccurs="1" maxOccurs="1">
                <annotation>
                    <documentation>
                        The date and time when this document was uploaded.
                    </documentation>
                </annotation>
            </element>
        </sequence>
    </complexType>
    <complexType name="DocumentUploadsType">
        <sequence minOccurs="1" maxOccurs="1">
            <element name="Document" type="tns:DocumentUploadType" minOccurs="0" maxOccurs="unbounded" nillable="true" />
        </sequence>
    </complexType>
    <complexType name="DocumentUploadType">
        <sequence minOccurs="1" maxOccurs="1">
            <element name="DocumentId" minOccurs="1" maxOccurs="1">
                <annotation>
                    <documentation>The technical id of the document to download.</documentation>
                </annotation>
                <simpleType>
                    <restriction base="int">
                        <minInclusive value="1" />
                    </restriction>
                </simpleType>
            </element>
            <element name="DocumentType" minOccurs="1" maxOccurs="1">
                <annotation>
                    <documentation>
                        NOTE: When attaching a DocumenTypeId that DocumentType has to be IsSelectable = true!
                        see Reference.GetAllDocumentTypes
                    </documentation>
                </annotation>
                <simpleType>
                    <restriction base="int">
                        <minInclusive value="1" />
                    </restriction>
                </simpleType>
            </element>
        </sequence>
    </complexType>
    <complexType name="LinksType">
        <sequence minOccurs="1" maxOccurs="1">
            <element name="Link" type="tns:LinkType" minOccurs="0" maxOccurs="unbounded" nillable="true" />
        </sequence>
    </complexType>
    <complexType name="LinkType">
        <annotation>
            <documentation>
                The system should process links based on Name and URL (not technical id's)
                The system should
            </documentation>
        </annotation>
        <sequence minOccurs="1" maxOccurs="1">
            <element name="Name" minOccurs="1" maxOccurs="1">
                <simpleType>
                    <restriction base="string">
                        <minLength value="1" />
                        <maxLength value="255" />
                    </restriction>
                </simpleType>
            </element>
            <element name="URL" minOccurs="1" maxOccurs="1">
                <annotation>
                    <documentation>e.g. http://www.company.nl</documentation>
                </annotation>
                <simpleType>
                    <restriction base="string">
                        <maxLength value="4000" />
                        <minLength value="10" />
                        <pattern value="((h|T)(t|T)(t|T)(p|P)(s?|S?)://.+)|((f|F)(t|T)(p|P)://.+)" />
                    </restriction>
                </simpleType>
            </element>
        </sequence>
    </complexType>
	<simpleType name="LocationType">
		<annotation>
			<documentation>
				This is an advanced search parameter in the GUI.
				Unknown
				Headquarters (=Hoofd)
				Branch (=Neven)
				Subsidiary (= Dochter)
				Standalone (= Alleenstaand)
			</documentation>
		</annotation>
		<restriction base="string">
			<enumeration value="Unknown" />
			<enumeration value="Headquarters" />
			<enumeration value="Branch" />
			<enumeration value="Subsidiary" />
			<enumeration value="Standalone" />
		</restriction>
	</simpleType>
    <complexType name="LocationTypes">
        <sequence minOccurs="1" maxOccurs="1">
            <element name="LocationType" type="tns:LocationType" minOccurs="0" maxOccurs="unbounded" />
        </sequence>
    </complexType>
    <complexType name="OrganisationHistoryType">
        <sequence minOccurs="1" maxOccurs="1">
            <element name="HistoryRow" type="tns:OrganisationHistoryRowType" minOccurs="1" maxOccurs="unbounded">
                <annotation>
                    <documentation>Contains one row of the history of the organisation.</documentation>
                </annotation>
            </element>
        </sequence>
    </complexType>
    <complexType name="OrganisationHistoryRowType">
        <annotation>
            <documentation />
        </annotation>
        <sequence minOccurs="1" maxOccurs="1">
            <annotation>
                <documentation />
            </annotation>
            <element name="UserId" minOccurs="1" maxOccurs="1">
                <annotation>
                    <documentation>
                        The id USER of the user.
                        See operation Reference.GetUserById
                    </documentation>
                </annotation>
                <simpleType>
                    <restriction base="int">
                        <minInclusive value="1" />
                    </restriction>
                </simpleType>
            </element>
            <element name="Source" minOccurs="1" maxOccurs="1">
                <annotation>
                    <documentation>The How of the change</documentation>
                </annotation>
                <simpleType>
                    <restriction base="string">
                        <enumeration value="Manual" />
                        <enumeration value="DnB" />
                        <enumeration value="InitialImport" />
                        <enumeration value="Linked" />
                        <enumeration value="ManualActivate" />
                        <enumeration value="Deactivate" />
						<enumeration value="SharedInvestigation" />
						<enumeration value="Graydon" />
						
                    </restriction>
                </simpleType>
            </element>
            <element name="Date" type="date" minOccurs="1" maxOccurs="1" />
        </sequence>
    </complexType>
    <complexType name="InvestigationIdsType">
        <sequence minOccurs="1">
            <element name="InvestigationId" type="tns:InvestigationIdType" minOccurs="0" maxOccurs="unbounded" nillable="false" />
        </sequence>
    </complexType>
    <complexType name="InvestigationIdType">
        <sequence minOccurs="1" maxOccurs="1">
            <element name="InvestigationId" minOccurs="1" maxOccurs="1">
                <simpleType>
                    <restriction base="int">
                        <minInclusive value="1" />
                    </restriction>
                </simpleType>
            </element>
        </sequence>
    </complexType>
    <complexType name="OrganisationIdRangeType">
        <sequence minOccurs="1" maxOccurs="1">
            <element name="IdRangeMatchType" minOccurs="1" maxOccurs="1" default="EqualTo">
                <simpleType>
                    <restriction base="string">
                        <enumeration value="GreaterThan" />
                        <enumeration value="GreatherThanOrEqualTo" />
                        <enumeration value="EqualTo" />
                    </restriction>
                </simpleType>
            </element>
            <element name="OrganisationId" minOccurs="1" maxOccurs="1">
                <simpleType>
                    <restriction base="int">
                        <minInclusive value="1" />
                    </restriction>
                </simpleType>
            </element>
        </sequence>
    </complexType>
    <complexType name="OrganisationGetType">
        <annotation>
            <documentation />
        </annotation>
        <sequence minOccurs="1" maxOccurs="1">
            <element name="Id" minOccurs="1" maxOccurs="1">
                <annotation>
                    <documentation>Unique technical id of the returned user organisation</documentation>
                </annotation>
                <simpleType>
                    <restriction base="int">
                        <minInclusive value="1" />
                    </restriction>
                </simpleType>
            </element>
            <element name="DUNSNumber" minOccurs="0" maxOccurs="1" nillable="true">
                <annotation>
                    <documentation>Use exactly 9 positions for DUNSNumbers: DUNSNumbers are often displayed with these separators. But in the DUNS API these can not be passed along or returned. In the response 9 positions are returned without separators.</documentation>
                </annotation>
                <simpleType>
                    <restriction base="string">
                        <maxLength value="9" />
                        <minLength value="9" />
                        <pattern value="[0-9]{9}" />
                    </restriction>
                </simpleType>
            </element>
            <element name="KvKNumber" minOccurs="0" maxOccurs="1" nillable="true">
                <annotation>
                    <documentation>Use exactly 8 positions for KvK numbers. Use leading zeros if the number has less than 8 positions.</documentation>
                </annotation>
                <simpleType>
                    <restriction base="string">
                        <maxLength value="8" />
                        <minLength value="8" />
                        <pattern value="[0-9]{8}" />
                    </restriction>
                </simpleType>
            </element>
            <element name="Source" minOccurs="1" maxOccurs="1">
                <annotation>
                    <documentation />
                </annotation>
                <simpleType>
                    <restriction base="string">
                        <enumeration value="Manual" />
                        <enumeration value="DnB" />
						<enumeration value="Graydon" />
                    </restriction>
                </simpleType>
            </element>
            <element name="FormalName" minOccurs="1" maxOccurs="1">
                <simpleType>
                    <restriction base="string">
                        <minLength value="1" />
                        <maxLength value="250" />
                    </restriction>
                </simpleType>
            </element>
            <element name="TradeNames" type="tns:TradeNamesType" minOccurs="1" maxOccurs="1" nillable="true" />
            <element name="RegistrationCodes" type="tns:RegistrationCodesType" minOccurs="1" maxOccurs="1">
                <annotation>
                    <documentation>
                        For details:
                        https://e-justice.europa.eu/content_business_registers_in_member_states-106-nl.do?clang=nl
                        https://opencorporates.com/
                    </documentation>
                </annotation>
            </element>
            <element name="LegalFormId" minOccurs="1" maxOccurs="1">
                <annotation>
                    <documentation>Refers to Reference.GetAllLegalForms id</documentation>
                </annotation>
                <simpleType>
                    <restriction base="int">
                        <minInclusive value="0" />
                    </restriction>
                </simpleType>
            </element>
            <element name="Phone" minOccurs="0" maxOccurs="1" nillable="true">
                <simpleType>
                    <restriction base="string">
                        <maxLength value="20" />
                        <minLength value="1" />
                    </restriction>
                </simpleType>
            </element>
            <element name="AddressLine" minOccurs="1" maxOccurs="1">
                <annotation>
                    <documentation>Adress standard: https://en.wikipedia.org/wiki/Address_(geography)</documentation>
                </annotation>
                <simpleType>
                    <restriction base="string">
                        <maxLength value="200" />
                        <minLength value="1" />
                    </restriction>
                </simpleType>
            </element>
            <element name="ZipCode" minOccurs="1" maxOccurs="1">
                <simpleType>
                    <restriction base="string">
                        <maxLength value="10" />
                        <minLength value="1" />
                    </restriction>
                </simpleType>
            </element>
            <element name="City" minOccurs="1" maxOccurs="1">
                <simpleType>
                    <restriction base="string">
                        <maxLength value="200" />
                        <minLength value="1" />
                    </restriction>
                </simpleType>
            </element>
            <element name="CountryId" minOccurs="1" maxOccurs="1">
                <annotation>
                    <documentation>
                        See operation Reference.GetAllCountries
                        Note: not the same as BankAccountCountryId
                    </documentation>
                </annotation>
                <simpleType>
                    <restriction base="int">
                        <minInclusive value="1" />
                    </restriction>
                </simpleType>
            </element>
            <element name="BankAccountCountryId" minOccurs="0" maxOccurs="1" nillable="true">
                <annotation>
                    <documentation>
                        See operation Reference.GetAllCountries
                        Note: not the same as CountryId
                    </documentation>
                </annotation>
                <simpleType>
                    <restriction base="int">
                        <minInclusive value="1" />
                    </restriction>
                </simpleType>
            </element>
            <element name="LocationTypes" type="tns:LocationTypes" minOccurs="1" maxOccurs="1" nillable="true">
                <annotation>
                    <documentation>
                        List of LocationTypes
                    </documentation>
                </annotation>
            </element>
            <element name="Status" minOccurs="1" maxOccurs="1" default="Active">
                <annotation>
                    <documentation>Active (=DEFAULT)</documentation>
                </annotation>
                <simpleType>
                    <restriction base="string">
                        <enumeration value="Active" />
                        <enumeration value="OutOfBusiness" />
                        <enumeration value="Dormant" />
                    </restriction>
                </simpleType>
            </element>
            <element name="EstablishedOn" type="dateTime" minOccurs="0" maxOccurs="1" nillable="true" />
            <element name="Activities" minOccurs="0" maxOccurs="1" nillable="true">
                <annotation>
                    <documentation>NOTE: Currently in DB nvarchar(max). Therefore no Max Length at the moment. Should change in the future!</documentation>
                </annotation>
                <simpleType>
                    <restriction base="string">
                        <minLength value="1" />
                    </restriction>
                </simpleType>
            </element>
            <element name="NumberOfEmployees" minOccurs="0" maxOccurs="1" nillable="true">
                <simpleType>
                    <restriction base="int">
                        <minInclusive value="0" />
                    </restriction>
                </simpleType>
            </element>
            <element name="OrganisationUrl" minOccurs="0" maxOccurs="1" nillable="true">
                <annotation>
                    <documentation>The URL of the organisation.</documentation>
                </annotation>
                <simpleType>
                    <restriction base="string">
                        <minLength value="1" />
                        <maxLength value="250" />
                        <pattern value="((h|T)(t|T)(t|T)(p|P)(s?|S?)://.+)|((f|F)(t|T)(p|P)://.+)" />
                    </restriction>
                </simpleType>
            </element>
            <element name="ReferenceNumbers" minOccurs="0" maxOccurs="1" nillable="true">
                <simpleType>
                    <restriction base="string">
                        <minLength value="1" />
                        <maxLength value="2000" />
                    </restriction>
                </simpleType>
            </element>
            <element name="Documents" type="tns:DocumentDownloadsType" minOccurs="0" maxOccurs="1" nillable="true" />
            <element name="Links" type="tns:LinksType" minOccurs="0" maxOccurs="1" nillable="true" />
            <element name="Comments" minOccurs="0" maxOccurs="1" nillable="true">
                <annotation />
                <simpleType>
                    <restriction base="string">
                        <minLength value="1" />
                        <maxLength value="2000" />
                    </restriction>
                </simpleType>
            </element>
            <element name="History" type="tns:OrganisationHistoryType" minOccurs="1" maxOccurs="1" />
            <element name="InvestigationIds" type="tns:InvestigationIdsType" minOccurs="0" maxOccurs="1" nillable="true" />
            <element name="IsActiveRelation" type="boolean" minOccurs="1" maxOccurs="1" />
        </sequence>
    </complexType>
    <complexType name="RegistrationCodesType">
        <sequence minOccurs="1" maxOccurs="1">
            <element name="RegistrationCode" type="tns:RegistrationCodeGetType" minOccurs="0" maxOccurs="unbounded" />
        </sequence>
    </complexType>
    <complexType name="RegistrationCodeGetType">
        <annotation>
            <documentation>
                This type contains the combination of
                1) The RegistrationCodeType Id (e.g. id of "Registratienummer Nederland")
                2) The RegistrationCode value (e.g. "12345678")
                used in responses
            </documentation>
        </annotation>
        <sequence minOccurs="1" maxOccurs="1">
            <element name="RegistrationCodeTypeId" minOccurs="1" maxOccurs="1">
                <annotation>
                    <documentation>
                        Unique id of the RegistratationCodeType:
                        See operation Reference.GetAllRegistrationCodeTypes
                    </documentation>
                </annotation>
                <simpleType>
                    <restriction base="integer">
                        <minInclusive value="0" />
                    </restriction>
                </simpleType>
            </element>
            <element name="RegistrationCode" minOccurs="1" maxOccurs="1">
                <annotation>
                    <documentation />
                </annotation>
                <simpleType>
                    <restriction base="string">
                        <minLength value="1" />
                        <maxLength value="100" />
                    </restriction>
                </simpleType>
            </element>
        </sequence>
    </complexType>
    <complexType name="SearchOrganisationsByCriteriaResultsType">
        <sequence minOccurs="1" maxOccurs="1">
            <element name="Organisation" type="tns:SearchOrganisationsByCriteriaResultType" minOccurs="0" maxOccurs="unbounded" nillable="true" />
        </sequence>
    </complexType>
    <complexType name="SearchOrganisationsByCriteriaResultType">
        <annotation>
            <documentation />
        </annotation>
        <sequence minOccurs="1" maxOccurs="1">
            <element name="Id" minOccurs="1" maxOccurs="1">
                <annotation>
                    <documentation>Unique technical id of the returned user organisation</documentation>
                </annotation>
                <simpleType>
                    <restriction base="int">
                        <minInclusive value="1" />
                    </restriction>
                </simpleType>
            </element>
            <element name="Source" minOccurs="1" maxOccurs="1">
                <annotation>
                    <documentation>This element combined with Id and DUNSNumber can be used to split the results as in the GUI.</documentation>
                </annotation>
                <simpleType>
                    <restriction base="string">
                        <enumeration value="Manual" />
                        <enumeration value="DnB" />
						<enumeration value="Graydon" />
                    </restriction>
                </simpleType>
            </element>
            <element name="FormalName" minOccurs="1" maxOccurs="1">
                <simpleType>
                    <restriction base="string">
                        <minLength value="1" />
                        <maxLength value="250" />
                    </restriction>
                </simpleType>
            </element>
            <element name="TradeNames" type="tns:TradeNamesType" minOccurs="1" maxOccurs="1" nillable="true" />
            <element name="DUNSNumber" minOccurs="0" maxOccurs="1" nillable="true">
                <annotation>
                    <documentation>Use exactly 9 positions for DUNSNumbers: DUNSNumbers are often displayed with these separators. But in the DUNS API these can not be passed along or returned. In the response 9 positions are returned without separators.</documentation>
                </annotation>
                <simpleType>
                    <restriction base="string">
                        <maxLength value="9" />
                        <minLength value="9" />
                        <pattern value="[0-9]{9}" />
                    </restriction>
                </simpleType>
            </element>
            <element name="KvKNumber"
                     minOccurs="0"
                     maxOccurs="1"
                     nillable="true">
                <annotation>
                    <documentation>Use exactly 8 positions for KvK numbers. Use leading zeros if the number has less than 8 positions.</documentation>
                </annotation>
                <simpleType>
                    <restriction base="string">
                        <maxLength value="8" />
                        <minLength value="8" />
                        <pattern value="[0-9]{8}" />
                    </restriction>
                </simpleType>
            </element>
            <element name="RegistrationCodes" type="tns:RegistrationCodesType" minOccurs="1" maxOccurs="1" />
            <element name="LegalFormId" minOccurs="1" maxOccurs="1">
                <simpleType>
                    <restriction base="int">
                        <minInclusive value="0" />
                    </restriction>
                </simpleType>
            </element>
            <element name="AddressLine" minOccurs="1" maxOccurs="1" nillable="true">
                <simpleType>
                    <restriction base="string">
                        <maxLength value="200" />
                        <minLength value="1" />
                    </restriction>
                </simpleType>
            </element>
            <element name="ZipCode" minOccurs="1" maxOccurs="1" nillable="true">
                <simpleType>
                    <restriction base="string">
                        <maxLength value="10" />
                        <minLength value="1" />
                    </restriction>
                </simpleType>
            </element>
            <element name="City" minOccurs="1" maxOccurs="1" nillable="true">
                <simpleType>
                    <restriction base="string">
                        <maxLength value="200" />
                        <minLength value="1" />
                    </restriction>
                </simpleType>
            </element>
            <element name="CountryId" minOccurs="1" maxOccurs="1" nillable="true">
                <annotation>
                    <documentation>See operation Reference.GetAllCountries</documentation>
                </annotation>
                <simpleType>
                    <restriction base="int">
                        <minInclusive value="1" />
                    </restriction>
                </simpleType>
            </element>
            <element name="LocationTypes" type="tns:LocationTypes" minOccurs="1" maxOccurs="1" nillable="true">
                <annotation>
                    <documentation>
                        List of LocationTypes
                    </documentation>
                </annotation>
            </element>
            <element name="Status" minOccurs="1" maxOccurs="1">
                <simpleType>
                    <restriction base="string">
                        <enumeration value="Unknown" />
                        <enumeration value="Active" />
                        <enumeration value="OutOfBusiness" />
                        <enumeration value="Dormant" />
                    </restriction>
                </simpleType>
            </element>
            <element name="InvestigationIds" type="tns:InvestigationIdsType" minOccurs="0" maxOccurs="1" nillable="true" />
        </sequence>
    </complexType>
    <complexType name="UpdateOrganisationByIdResponseType">
        <sequence minOccurs="1" maxOccurs="1">
            <element name="Id" type="int" minOccurs="1" maxOccurs="1">
                <annotation>
                    <documentation>
                        Unique technical id of the organisation.
                        Can be used to call the Organisation.GetOrganisationById operation
                    </documentation>
                </annotation>
            </element>
            <element name="ModifiedByUserId" minOccurs="1" maxOccurs="1" nillable="true">
                <annotation>
                    <documentation>See operation Reference.GetUserById</documentation>
                </annotation>
                <simpleType>
                    <restriction base="int">
                        <minInclusive value="1" />
                    </restriction>
                </simpleType>
            </element>
            <element name="ModifiedOnAt" type="dateTime" minOccurs="1" maxOccurs="1" nillable="true" />
        </sequence>
    </complexType>
    <complexType name="PagingRequestType">
        <sequence minOccurs="1" maxOccurs="1">
            <element name="PageSize" minOccurs="1" maxOccurs="1" default="100" nillable="false">
                <annotation>
                    <documentation>
                        The number of rows per page.
                        100 (=DEFAULT)
                    </documentation>
                </annotation>
                <simpleType>
                    <restriction base="string">
                        <enumeration value="10" />
                        <enumeration value="50" />
                        <enumeration value="100" />
                    </restriction>
                </simpleType>
            </element>
            <element name="PageNumber" minOccurs="1" maxOccurs="1" default="0" nillable="false">
                <annotation>
                    <documentation>
                        The requested page number
                        0 = The first page (=DEFAULT)
                    </documentation>
                </annotation>
                <simpleType>
                    <restriction base="int">
                        <minInclusive value="0" />
                    </restriction>
                </simpleType>
            </element>
        </sequence>
    </complexType>
    <complexType name="PagingResponseType">
        <sequence minOccurs="1" maxOccurs="1">
            <element name="PageSize" minOccurs="1" maxOccurs="1" default="100" nillable="false">
                <annotation>
                    <documentation>
                        The returned number of rows per page.
                        100 (=DEFAULT)
                    </documentation>
                </annotation>
                <simpleType>
                    <restriction base="string">
                        <enumeration value="10" />
                        <enumeration value="50" />
                        <enumeration value="100" />
                    </restriction>
                </simpleType>
            </element>
            <element name="PageNumber" minOccurs="1" maxOccurs="1" default="0" nillable="false">
                <annotation>
                    <documentation>
                        The returned page
                        0 = The first page (=DEFAULT)
                    </documentation>
                </annotation>
                <simpleType>
                    <restriction base="int">
                        <minInclusive value="0" />
                    </restriction>
                </simpleType>
            </element>
            <element name="Count" minOccurs="1" maxOccurs="1" nillable="false">
                <annotation>
                    <documentation>
                        The total number of search results.
                        Can be used to determine total page number.
                        First page = 0
                    </documentation>
                </annotation>
                <simpleType>
                    <restriction base="int">
                        <minInclusive value="0" />
                    </restriction>
                </simpleType>
            </element>
        </sequence>
    </complexType>
    <complexType name="RegistrationCodeCountryCreateType">
        <sequence minOccurs="1" maxOccurs="1">
            <element name="CountryId" minOccurs="1" maxOccurs="1" nillable="true">
                <annotation>
                    <documentation>See operation Reference.GetAllCountries</documentation>
                </annotation>
                <simpleType>
                    <restriction base="int">
                        <minInclusive value="1" />
                    </restriction>
                </simpleType>
            </element>
            <element name="RegistrationCode" minOccurs="1" maxOccurs="1">
                <annotation>
                    <documentation />
                </annotation>
                <simpleType>
                    <restriction base="string">
                        <minLength value="1" />
                        <maxLength value="100" />
                    </restriction>
                </simpleType>
            </element>
        </sequence>
    </complexType>
    <complexType name="SubjectOrganisationCreateCreateType">
        <annotation>
            <documentation>Provide DUNSNumber OR KvKNumber OR RegistrationCodeCountry</documentation>
        </annotation>
        <choice minOccurs="1" maxOccurs="1">
            <element name="DUNSNumber" minOccurs="0" maxOccurs="1" nillable="true">
                <annotation>
                    <documentation>Use exactly 9 positions for DUNSNumbers: DUNSNumbers are often displayed with these separators. But in the DUNS API these can not be passed along or returned. In the response 9 positions are returned without separators.</documentation>
                </annotation>
                <simpleType>
                    <restriction base="string">
                        <minLength value="9" />
                        <maxLength value="9" />
                        <pattern value="[0-9]{9}" />
                    </restriction>
                </simpleType>
            </element>
            <element name="KvKNumber"
                     minOccurs="0"
                     maxOccurs="1"
                     nillable="true">
                <annotation>
                    <documentation>Use exactly 8 positions for KvK numbers. Use leading zeros if the number has less than 8 positions.</documentation>
                </annotation>
                <simpleType>
                    <restriction base="string">
                        <maxLength value="8" />
                        <minLength value="8" />
                        <pattern value="[0-9]{8}" />
                    </restriction>
                </simpleType>
            </element>
            <element name="RegistrationCodeCountry" type="tns:RegistrationCodeCountryCreateType" minOccurs="0" maxOccurs="1">
                <annotation>
                    <documentation>
                        NOTE: Only the RegistrationCode can be provided to duns *NOT* the RegistrationCodeTypeId. Therefore multiple or unintended organisations could match.
                        In that case an error message is returned.
                    </documentation>
                </annotation>
            </element>
        </choice>
    </complexType>
    <complexType name="TradeNamesType">
        <sequence minOccurs="1" maxOccurs="1">
            <element name="TradeName" type="tns:TradeNameType" minOccurs="0" maxOccurs="unbounded" />
        </sequence>
    </complexType>
    <complexType name="TradeNameType">
        <sequence minOccurs="1" maxOccurs="1">
            <element name="TradeName" minOccurs="1" maxOccurs="1" nillable="true">
                <simpleType>
                    <restriction base="string">
                        <minLength value="1" />
                        <maxLength value="250" />
                    </restriction>
                </simpleType>
            </element>
        </sequence>
    </complexType>
    <element name="CreateOrganisationRequest">
        <annotation>
            <documentation />
        </annotation>
        <complexType>
            <sequence minOccurs="1" maxOccurs="1">
                <group ref="tns:OnBehalfUserGroup" />
                <element name="SubjectOrganisationCreateType" type="tns:SubjectOrganisationCreateCreateType" minOccurs="1" maxOccurs="1">
                    <annotation>
                        <documentation>
                            Nillable
                        </documentation>
                    </annotation>
                </element>
                <element name="BankAccountCountry" minOccurs="0" maxOccurs="1" nillable="true">
                    <annotation>
                        <documentation>See operation Reference.GetAllCountries</documentation>
                    </annotation>
                    <simpleType>
                        <restriction base="int">
                            <minInclusive value="1" />
                        </restriction>
                    </simpleType>
                </element>
                <element name="ReferenceNumbers" minOccurs="0" maxOccurs="1" nillable="true">
                    <simpleType>
                        <restriction base="string">
                            <minLength value="1" />
                            <maxLength value="500" />
                        </restriction>
                    </simpleType>
                </element>
                <element name="Documents" type="tns:DocumentUploadsType" minOccurs="0" maxOccurs="1" nillable="true" />
                <element name="Links" type="tns:LinksType" minOccurs="0" maxOccurs="1" nillable="true" />
                <element name="Comments" minOccurs="0" maxOccurs="1" nillable="true">
                    <annotation>
                        <documentation />
                    </annotation>
                    <simpleType>
                        <restriction base="string">
                            <minLength value="1" />
                            <maxLength value="2000" />
                        </restriction>
                    </simpleType>
                </element>
            </sequence>
        </complexType>
    </element>
    <element name="CreateOrganisationResponse">
        <complexType>
            <sequence minOccurs="1" maxOccurs="1">
                <element name="Organisation" type="tns:CreateOrganisationResponseType" minOccurs="1" maxOccurs="1" />
            </sequence>
        </complexType>
    </element>
    <element name="GetOrganisationsByDUNSNumberRequest">
        <complexType>
            <sequence minOccurs="1" maxOccurs="1">
                <group ref="tns:OnBehalfUserGroup" />
                <element name="DUNSNumber" minOccurs="1" maxOccurs="1">
                    <annotation>
                        <documentation>
                            Use at least 9 positions to search in DUNSNumbers.
                            It is possible to use separators or spaces: these will be ignored when searching.
                            DUNS numbers are often displayed with these separators. But in the API these can not be passed along or returned.
                        </documentation>
                    </annotation>
                    <simpleType>
                        <restriction base="string">
                            <minLength value="9" />
                            <maxLength value="9" />
                            <pattern value="[0-9]{9}" />
                        </restriction>
                    </simpleType>
                </element>
            </sequence>
        </complexType>
    </element>
    <element name="GetOrganisationsByDUNSNumberResponse">
        <complexType>
            <sequence minOccurs="1" maxOccurs="1">
                <element name="Organisations" type="tns:SearchOrganisationsByCriteriaResultsType" minOccurs="1" maxOccurs="1">
                    <annotation>
                        <documentation>
                        </documentation>
                    </annotation>
                </element>
            </sequence>
        </complexType>
    </element>
    <element name="GetOrganisationsByKvKNumberRequest">
        <complexType>
            <sequence minOccurs="1" maxOccurs="1">
                <group ref="tns:OnBehalfUserGroup" />
                <element name="KvKNumber"
                         minOccurs="1"
                         maxOccurs="1">
                    <annotation>
                        <documentation>Use exactly 8 positions for KvK numbers. Use leading zeros if the number has less than 8 positions.</documentation>
                    </annotation>
                    <simpleType>
                        <restriction base="string">
                            <maxLength value="8" />
                            <minLength value="8" />
                            <pattern value="[0-9]{8}" />
                        </restriction>
                    </simpleType>
                </element>            
            </sequence>
        </complexType>
    </element>
    <element name="GetOrganisationsByKvKNumberResponse">
        <complexType>
            <sequence minOccurs="1" maxOccurs="1">
                <element name="Organisations" type="tns:SearchOrganisationsByCriteriaResultsType" minOccurs="1" maxOccurs="1">
                    <annotation>
                        <documentation>
                        </documentation>
                    </annotation>
                </element>
            </sequence>
        </complexType>
    </element>
    <element name="GetOrganisationsByRegistrationCodeRequest">
        <complexType>
            <sequence minOccurs="1" maxOccurs="1">
                <group ref="tns:OnBehalfUserGroup" />
                <element name="RegistrationCode" minOccurs="1" maxOccurs="1">
                    <annotation>
                        <documentation />
                    </annotation>
                    <simpleType>
                        <restriction base="string">
                            <minLength value="1" />
                            <maxLength value="100" />
                        </restriction>
                    </simpleType>
                </element>
                <element name="RegistrationCodeMatchType" minOccurs="0" maxOccurs="1" default="Contains">
                    <annotation>
                        <documentation>
                            Used in combination with RegistrationCodeGetType value to search for specific registration codes.

                            Note: searching on this match type can only be done on organisations allready existing within the Sanctieplatform, since DNB API does not support match type searching.
                        </documentation>
                    </annotation>
                    <simpleType>
                        <restriction base="string">
                            <enumeration value="Equals" />
                            <enumeration value="StartsWith" />
                            <enumeration value="Contains" />
                        </restriction>
                    </simpleType>
                </element>
                <element name="CountryId" minOccurs="1" maxOccurs="1" nillable="false">
                    <annotation>
                        <documentation>
                            Both active and inactive countries can be used.
                            See operation Reference.GetAllCountries.
                            Technical id of Nederland (=DEFAULT)
                        </documentation>
                    </annotation>
                    <simpleType>
                        <restriction base="int">
                            <minInclusive value="1" />
                        </restriction>
                    </simpleType>
                </element>
            </sequence>
        </complexType>
    </element>
    <element name="GetOrganisationsByRegistrationCodeResponse">
        <complexType>
            <sequence minOccurs="1" maxOccurs="1">
                <element name="Organisations" type="tns:SearchOrganisationsByCriteriaResultsType" minOccurs="1" maxOccurs="1" />
            </sequence>
        </complexType>
    </element>
    <element name="GetOrganisationByIdRequest">
        <complexType>
            <sequence minOccurs="1" maxOccurs="1">
                <group ref="tns:OnBehalfUserGroup" />
                <element name="OrganisationId" minOccurs="1" maxOccurs="1">
                    <simpleType>
                        <restriction base="integer">
                            <minInclusive value="1" />
                        </restriction>
                    </simpleType>
                </element>
            </sequence>
        </complexType>
    </element>
    <element name="GetOrganisationByIdResponse">
        <complexType>
            <sequence minOccurs="1" maxOccurs="1">
                <element name="Organisation" type="tns:OrganisationGetType" minOccurs="1" maxOccurs="1" nillable="true" />
            </sequence>
        </complexType>
    </element>
    <element name="SearchOrganisationsByCriteriaRequest">
        <annotation>
            <documentation>
                At least one of the following elements should be supplied:
                - DUNSNumber
                - Name
                - KvKNumber
                - RegistrationCode

                Some search combinations are not allowed. In the GUI these criteria are disabled.
                These combinations are described in the subelements. And can be found in "FO Organisaties"
            </documentation>
        </annotation>
        <complexType>
            <sequence minOccurs="1" maxOccurs="1">
                <group ref="tns:OnBehalfUserGroup" />
                <element name="OrganisationIdRange" type="tns:OrganisationIdRangeType" minOccurs="0" maxOccurs="1" nillable="true" />
                <element name="DUNSNumber" minOccurs="0" maxOccurs="1" nillable="true">
                    <annotation>
                        <documentation>
                            Can not be used in combination with RegistrationCode, Name and Country.
                            Use exactly 9 positions for DUNSNumbers: DUNSNumbers are often displayed with these separators. But in the DUNS API these can not be passed along or returned. In the response 9 positions are returned without separators.
                        </documentation>
                    </annotation>
                    <simpleType>
                        <restriction base="string">
                            <minLength value="9" />
                            <maxLength value="9" />
                            <pattern value="[0-9]{9}" />
                        </restriction>
                    </simpleType>
                </element>
                <element name="KvKNumber"
                         minOccurs="0"
                         maxOccurs="1"
                         nillable="true">
                    <annotation>
                        <documentation>Use exactly 8 positions for KvK numbers. Use leading zeros if the number has less than 8 positions.</documentation>
                    </annotation>
                    <simpleType>
                        <restriction base="string">
                            <maxLength value="8" />
                            <minLength value="8" />
                            <pattern value="[0-9]{8}" />
                        </restriction>
                    </simpleType>
                </element>
                <element name="RegistrationCode" minOccurs="0" maxOccurs="1" nillable="true">
                    <annotation>
                        <documentation>Can not be used in combination with DUNSNumber and Name.</documentation>
                    </annotation>
                    <simpleType>
                        <restriction base="string">
                            <minLength value="1" />
                            <maxLength value="100" />
                        </restriction>
                    </simpleType>
                </element>
                <element name="Name" minOccurs="0" maxOccurs="1" nillable="true">
                    <annotation>
                        <documentation>
                            Can not be used in combination with DUNSNumber, RegistrationCode, Name, AddressLine, ZipCode, City, Phone, LocationType, Status or ReferenceNumber
                            Searches in FormalName and TradeName combined with Country
                        </documentation>
                    </annotation>
                    <simpleType>
                        <restriction base="string">
                            <maxLength value="250" />
                            <minLength value="2" />
                        </restriction>
                    </simpleType>
                </element>
                <element name="CountryId" minOccurs="0" maxOccurs="1" nillable="true">
                    <annotation>
                        <documentation>
                            Mandatory when Name or RegistrationCode is searched
                            Both active and inactive countries can be used.
                            See operation Reference.GetAllCountries.
                            Technical id of Nederland (=DEFAULT)
                        </documentation>
                    </annotation>
                    <simpleType>
                        <restriction base="int">
                            <minInclusive value="1" />
                        </restriction>
                    </simpleType>
                </element>
                <element name="Source" minOccurs="0" maxOccurs="1" default="All" nillable="true">
                    <annotation>
                        <documentation>All (=DEFAULT)</documentation>
                    </annotation>
                    <simpleType>
                        <restriction base="string">
                            <enumeration value="All" />
                            <enumeration value="DUNSNumber" />
                            <enumeration value="Manual" />
                        </restriction>
                    </simpleType>
                </element>
                <element name="AddressLine" minOccurs="0" maxOccurs="1" nillable="true">
                    <annotation>
                        <documentation>
                            This is an advanced search parameter in the GUI.
                            Combined with Name and Country
                        </documentation>
                    </annotation>
                    <simpleType>
                        <restriction base="string">
                            <maxLength value="200" />
                            <minLength value="1" />
                        </restriction>
                    </simpleType>
                </element>
                <element name="ZipCode" minOccurs="0" maxOccurs="1" nillable="true">
                    <annotation>
                        <documentation>
                            This is an advanced search parameter in the GUI.
                            Combined with Name and Country
                        </documentation>
                    </annotation>
                    <simpleType>
                        <restriction base="string">
                            <maxLength value="10" />
                            <minLength value="1" />
                        </restriction>
                    </simpleType>
                </element>
                <element name="City" minOccurs="0" maxOccurs="1" nillable="true">
                    <annotation>
                        <documentation>
                            This is an advanced search parameter in the GUI.
                            Combined with Name and Country
                        </documentation>
                    </annotation>
                    <simpleType>
                        <restriction base="string">
                            <maxLength value="200" />
                            <minLength value="1" />
                        </restriction>
                    </simpleType>
                </element>
                <element name="Phone" minOccurs="0" maxOccurs="1" nillable="true">
                    <annotation>
                        <documentation>
                            This is an advanced search parameter in the GUI.
                            Combined with Name and Country
                        </documentation>
                    </annotation>
                    <simpleType>
                        <restriction base="string">
                            <maxLength value="20" />
                            <minLength value="1" />
                        </restriction>
                    </simpleType>
                </element>
                <element name="LocationType" minOccurs="0" maxOccurs="1">
                    <annotation>
                        <documentation>
                            This is an advanced search parameter in the GUI.
                            Unknown
                            Headquarters (=Hoofd)
                            Branch (=Neven
                            Subsidiary (= Dochter)
                            Standalone (= Alleenstaand)
                        </documentation>
                    </annotation>
                    <simpleType>
                        <restriction base="string">
                            <enumeration value="Unknown" />
                            <enumeration value="Headquarters" />
                            <enumeration value="Branch" />
                            <enumeration value="Subsidiary" />
                            <enumeration value="Standalone" />
                        </restriction>
                    </simpleType>
                </element>
                <element name="Status" minOccurs="0" maxOccurs="1" nillable="true">
                    <annotation>
                        <documentation>
                            This is an advanced search parameter in the GUI.
                        </documentation>
                    </annotation>
                    <simpleType>
                        <restriction base="string">
                            <enumeration value="Unknown" />
                            <enumeration value="Active" />
                            <enumeration value="OutOfBusiness" />
                            <enumeration value="Dormant" />
                            <minLength value="1" />
                        </restriction>
                    </simpleType>
                </element>
                <element name="ReferenceNumber" type="string" minOccurs="0" maxOccurs="1" nillable="true">
                    <annotation>
                        <documentation>
                            Searches in own references. Only for ORGANISATIONS within platform.
                            This is an advanced search parameter in the GUI.
                        </documentation>
                    </annotation>
                </element>
                <element name="OrderBy" type="string" minOccurs="0" maxOccurs="1" nillable="true">
                    <annotation>
                        <documentation>Field to sort on</documentation>
                    </annotation>
                </element>
				<element name="OrderDirection" type="tns:OrganisationOrderDirection" minOccurs="0" maxOccurs="1" default="Descending" nillable="true">
					<annotation>
						<documentation>Descending (=DEFAULT)</documentation>
					</annotation>
				</element>
                <element name="Paging" type="tns:PagingRequestType" minOccurs="1" maxOccurs="1" nillable="false" />
            </sequence>
        </complexType>
    </element>
    <element name="SearchOrganisationsByCriteriaResponse">
        <complexType>
            <sequence minOccurs="1" maxOccurs="1">
                <element name="Organisations" type="tns:SearchOrganisationsByCriteriaResultsType" minOccurs="1" maxOccurs="1">
                    <annotation>
                        <documentation>The elements returnded within Organisations are ordered by Organisation Id descending (latest first).</documentation>
                    </annotation>
                </element>
                <element name="Paging" type="tns:PagingResponseType" minOccurs="1" maxOccurs="1" />
            </sequence>
        </complexType>
    </element>
    <element name="UpdateOrganisationByIdRequest">
        <annotation>
            <documentation>
                Always set *all* values in the update request including unchanged values!


            </documentation>
        </annotation>
        <complexType>
            <sequence minOccurs="1" maxOccurs="1">
                <group ref="tns:OnBehalfUserGroup" />
                <element name="OrganisationId" minOccurs="1" maxOccurs="1">
                    <simpleType>
                        <restriction base="int">
                            <minInclusive value="1" />
                        </restriction>
                    </simpleType>
                </element>
                <element name="BankAccountCountry" minOccurs="0" maxOccurs="1" nillable="true">
                    <annotation>
                        <documentation>See operation Reference.GetAllCountries</documentation>
                    </annotation>
                    <simpleType>
                        <restriction base="int">
                            <minInclusive value="1" />
                        </restriction>
                    </simpleType>
                </element>
                <element name="ReferenceNumbers" minOccurs="0" maxOccurs="1" nillable="true">
                    <simpleType>
                        <restriction base="string">
                            <minLength value="1" />
                            <maxLength value="500" />
                        </restriction>
                    </simpleType>
                </element>
                <element name="Documents" type="tns:DocumentUploadsType" minOccurs="0" maxOccurs="1" nillable="true" />
                <element name="Links" type="tns:LinksType" minOccurs="0" maxOccurs="1" nillable="true">
                    <annotation>
                        <documentation>NOTE: No LINK id have to be supplied.</documentation>
                    </annotation>
                </element>
                <element name="Comments" minOccurs="0" maxOccurs="1" nillable="true">
                    <annotation>
                        <documentation />
                    </annotation>
                    <simpleType>
                        <restriction base="string">
                            <minLength value="1" />
                            <maxLength value="2000" />
                        </restriction>
                    </simpleType>
                </element>
            </sequence>
        </complexType>
    </element>
    <element name="UpdateOrganisationByIdResponse">
        <complexType>
            <sequence minOccurs="1" maxOccurs="1">
                <element name="Organisation" type="tns:UpdateOrganisationByIdResponseType" minOccurs="1" maxOccurs="1" />
            </sequence>
        </complexType>
    </element>
</schema>
