<?xml version="1.0" encoding="utf-8"?>
<schema targetNamespace="http://ws.infotorg.no/xml/Redningsselskapet/Smaabaatregisteret/2012-02-23/Smaabaatregisteret.xsd"
    xmlns:tns="http://ws.infotorg.no/xml/Redningsselskapet/Smaabaatregisteret/2012-02-23/Smaabaatregisteret.xsd"
    xmlns:feil="http://ws.infotorg.no/xml/Feil/Feil.xsd"
    xmlns="http://www.w3.org/2001/XMLSchema">

    <annotation>
        <documentation xml:lang="no">
            Datatyper for Småbåtregisteret.
            © 2012 Evry
            Forfatter: Kai A. Kristiansen &lt;kai.kristiansen@evry.com&gt;
        </documentation>
    </annotation>

    <include
        schemaLocation="https://ws.infotorg.no/xml/Redningsselskapet/Smaabaatregisteret/2012-02-23/include/medlem.xsd"/>

    <element name="hentEiersoek">
        <complexType>
            <sequence>
                <element name="foedselsdato" type="string" minOccurs="0"/>
                <element name="fornavn" type="string" minOccurs="0"/>
                <element name="etternavn" type="string" minOccurs="0"/>
                <element name="postnr" type="string" minOccurs="0"/>
                <element name="orgnavn" type="string" minOccurs="0"/>
                <element name="visStatus" type="tns:statusBegrensning" minOccurs="0">
                    <annotation>
                        <documentation xml:lang="no"> A = kun aktive. P = bare inaktive. D = bare døde. Hvis feltet utelates vises både aktive,inaktive og døde.</documentation>
                    </annotation>
                </element>
            </sequence>
        </complexType>
    </element>

    <element name="hentMotorsoek">
        <complexType>
            <sequence>
                <element name="motornr" type="string" minOccurs="0"/>
                <element name="plassering" type="string" minOccurs="0"/>
                <element name="fabrikkmerke" type="string" minOccurs="0"/>
                <element name="fraKwytelse" type="string" minOccurs="0"/>
                <element name="tilKwytelse" type="string" minOccurs="0">
                    <annotation>
                        <documentation xml:lang="no">Ytelse i kw</documentation>
                    </annotation>
                </element>
                <element name="motoraar" type="string" minOccurs="0"/>
                <element name="drivstoff" type="string" minOccurs="0"/>
                <element name="ownerNameId" type="string" minOccurs="0"/>
                <element name="vesselId" type="string" minOccurs="0"/>
                <element name="visHistoriske" type="tns:visAlleBegrensing" minOccurs="0">
                    <annotation>
                        <documentation xml:lang="no">Y = aktive og passive.  = kun aktive</documentation>
                    </annotation>
                </element>
            </sequence>
        </complexType>
    </element>

    <element name="hentMotorsoekL">
        <complexType>
            <sequence>
                <element name="ownerNameId" type="string" minOccurs="0"/>
                <element name="vesselId" type="string" minOccurs="0"/>
                <element name="motornr" type="string" minOccurs="0"/>
                 <element name="visHistoriske" type="tns:visAlleBegrensing" minOccurs="0">
                    <annotation>
                        <documentation xml:lang="no">Y = aktive og passive.  = kun aktive</documentation>
                    </annotation>
                </element>
<!--
                <element name="visStjaalet" type="tns:Begrensning">
                    <annotation>
                        <documentation xml:lang="no">Y = søker på stjålne og ikke stjålne. N = kun ikke stjålne. O = kun stjålne</documentation>
                    </annotation>
                </element>
-->
            </sequence>
        </complexType>
    </element>

    <element name="hentBaatsoekHistorisk">
        <complexType>
            <sequence>
                <element name="nameId" type="string" minOccurs="1"/>
			 </sequence>
        </complexType>
    </element>

    <element name="hentEiersoekHistorisk">
        <complexType>
            <sequence>
                <element name="childId" type="string" minOccurs="1"/>
			 </sequence>
        </complexType>
    </element>

     <element name="hentMedeiere">
        <complexType>
            <sequence>
                <element name="childId" type="string" minOccurs="1"/>
			 </sequence>
        </complexType>
    </element>

    <!-- Internal requests-->
	<element name = "hentAvtaler">
		<complexType>
            <sequence>

				<choice minOccurs="1" maxOccurs="1">
					<element name="childId" type="string" minOccurs="1"/>
					<element name="nameId" type="string" minOccurs="1"/>
				</choice>

			 </sequence>
        </complexType>
	</element>


	<element name = "hentFlereBaater">
		<complexType>
	 	    <sequence>
				<element name = "osGetVessel" type = "tns:FlereBaater" minOccurs="1" maxOccurs="unbounded" />
			</sequence>
		</complexType>
	</element>

	<complexType name = "FlereBaater">
				<sequence>
					<element name = "clientCode" type = "string" minOccurs="1"/>
					<element name = "vesselId" type = "string" minOccurs="1"/>
					<element name = "maxResultHits" type = "int" minOccurs="1"/>
					<element name = "callerSite" type = "string" minOccurs="1"/>
				</sequence>
		    </complexType>

	<element name = "hentFlereEiere">
		<complexType>
	 	    <sequence>
				<element name = "osSearchName" type = "tns:FlereEiere" minOccurs="1" maxOccurs="unbounded" />
			</sequence>
		</complexType>
	</element>

	<complexType name = "FlereEiere">
				<sequence>
					<element name = "clientCode" type = "string" minOccurs="1"/>
					<element name = "nameId" type = "string" minOccurs="1"/>
					<element name = "nameStatus" type = "string" minOccurs="1"/>
                                        <element name = "selectionJobId" type = "string" minOccurs="1"/>
					<element name = "maxResultHits" type = "int" minOccurs="1"/>
					<element name = "callerSite" type = "string" minOccurs="1"/>
				</sequence>
		    </complexType>

			                


    <element name="hentBaatsoek">
        <complexType>
            <sequence>
                <element name="baatNavn" type="string" minOccurs="0"/>
                <element name="regnr" type="string" minOccurs="0"/>
                <element name="CINnr" type="string" minOccurs="0"/>
                <element name="seilnummer" type="string" minOccurs="0"/>
                <element name="fabrikat" type="string" minOccurs="0"/>
                <element name="typebetegnelse" type="string" minOccurs="0"/>
                <element name="baatAar" type="string" minOccurs="0">
                    <annotation>
                        <documentation xml:lang="no">Årstall, format ÅÅÅÅ</documentation>
                    </annotation>
                </element>
                <element name="baattype" type="string" minOccurs="0"/>
                <element name="ownerNameId" type="string" minOccurs="0"/>
                <element name="visAvregistrerte" type="tns:visAlleBegrensing" minOccurs="0">
                    <annotation>
                        <documentation xml:lang="no">Y = både aktive og passive registreringer.  = kun aktive.</documentation>
                    </annotation>
                </element>
<!--
                <element name="visStjaalet" type="tns:Begrensning">
                    <annotation>
                        <documentation xml:lang="no">Y = søker på stjålne og ikke stjålne. N = kun ikke stjålne. O = kun stjålne</documentation>
                    </annotation>
                </element>
-->
            </sequence>
        </complexType>
    </element>

    <element name="hentBaatsoekL">
        <complexType>
            <sequence>
                <element name="ownerNameId" type="string" minOccurs="0"/>
                <element name="regnr" type="string" minOccurs="0"/>
                <element name="CINnr" type="string" minOccurs="0"/>
                <element name="visAvregistrerte" type="tns:visAlleBegrensing" minOccurs="0">
                    <annotation>
                        <documentation xml:lang="no">Y = både aktive og passive registreringer.  = kun aktive.</documentation>
                    </annotation>
                </element>
<!--
                <element name="visStjaalet" type="tns:Begrensning">
                    <annotation>
                        <documentation xml:lang="no">Y = søker på stjålne og ikke stjålne. N = kun ikke stjålne. O = kun stjålne</documentation>
                    </annotation>
                </element>
-->
            </sequence>
        </complexType>
    </element>

    <element name="hentEierdetaljer">
        <complexType>
            <sequence>
                <choice>
                    <element name="foedselsnr" type="string">
                        <annotation>
                            <documentation xml:lang="no">Helt personnummer</documentation>
                        </annotation>
                    </element>
                    <element name="orgnr" type="string">
                        <annotation>
                            <documentation xml:lang="no">Helt organisasjonsnummer.</documentation>
                        </annotation>
                    </element>
                    <element name="eierGuid" type="string"/>
                </choice>
            </sequence>
        </complexType>
    </element>

    <element name="hentMotordetaljer">
        <complexType>
            <sequence>
                <element name="motorGuid" type="string"/>
            </sequence>
        </complexType>
    </element>

    <element name="hentBaatdetaljer">
        <complexType>
            <sequence>
                <element name="baatGuid" type="string"/>
            </sequence>
        </complexType>
    </element>
<!--
    <simpleType name="Begrensning">
        <restriction base="string">
            <enumeration value="Y"/>
            <enumeration value="N"/>
            <enumeration value="O"/>
        </restriction>
    </simpleType>
-->
    <simpleType name="statusBegrensning">
        <restriction base="string">
            <enumeration value="A"/>
            <enumeration value="P"/>
            <enumeration value="D"/>
            <enumeration value=""/>
        </restriction>
    </simpleType>

   <simpleType name="visAlleBegrensing">
        <restriction base="string">
            <enumeration value="Y"/>
            <enumeration value=""/>
        </restriction>
    </simpleType>

    <!-- SVAR -->

    <element name="Eierdetaljer" type="tns:DsNameObject"/> 
    <element name="Eiersoek" type="tns:Eiersoek"/>
    <element name="EiersoekHistorisk" type="tns:EiersoekHistorisk"/>
    <element name="Baatsoek" type="tns:Baatsoek"/>
    <element name="BaatsoekHistorisk" type="tns:BaatsoekHistorisk"/>
    <element name="BaatsoekL" type="tns:Baatsoek"/>
    <element name="Baatdetaljer" type="tns:DsVesselObject"/> 
    <element name="Motorsoek" type="tns:Motorsoek"/> 
    <element name="MotorsoekL" type="tns:Motorsoek"/>
    <element name="Motordetaljer" type="tns:DsMotorObject"/>
    <element name="Medeiere" type="tns:DsContractObject"/>
    <element name="FlereBaater" type="tns:Baatsoek"/>
    <element name="FlereEiere" type="tns:Eiersoek"/>	


    <complexType name = "BaatsoekHistorisk">
		<sequence>
			<annotation>
            <documentation xml:lang="no">En liste med båter.</documentation>
        </annotation>
        <sequence>
            <choice minOccurs="1" maxOccurs="unbounded">
                <element name="feil" type="tns:feil"/>
                <sequence>
                     <sequence>
                        <element minOccurs="1" maxOccurs="1" name="OsVessel"
                            type="tns:osVessel" />
                        <element minOccurs="1" maxOccurs="1" name="OsStatusVessel"
                            type="tns:osStatusVessel" />
                        <element minOccurs="1" maxOccurs="1" name="OsStatusDetVessel"
                            type="tns:ArrayOfOsStatusDetVessel" />
                        </sequence>
					<element minOccurs="1" maxOccurs="1" name="Eierskap"
						type="tns:Eierskap" />
                </sequence>
            </choice>
        </sequence>
		</sequence>
    </complexType>

	<complexType name = "Eierskap">
		<sequence>
			<element name = "vesselId" type = "string" minOccurs="1" maxOccurs="1"/>
			<element name = "dtStartDate" type = "string" minOccurs="1" maxOccurs="1"/>
			<element name = "dtStopDate" type = "string" minOccurs="1" maxOccurs="1"/>
		</sequence>
	</complexType>

    <complexType name="Eiersoek">
        <annotation>
            <documentation xml:lang="no">En liste med eiere.</documentation>
        </annotation>
        <sequence>
            <choice minOccurs="1" maxOccurs="unbounded">
                <element name="feil" type="tns:feil"/>
                <sequence>
					<element minOccurs="1" maxOccurs="1" name="OsName"
						type="tns:osName" />
					<element minOccurs="1" maxOccurs="1" name="OsStatusName"
						type="tns:osStatusName" />
					<element minOccurs="1" maxOccurs="1" name="OsStatusDetName"
						type="tns:ArrayOfOsStatusDetName" />
				</sequence>
            </choice>
        </sequence>
    </complexType>

    <complexType name="EiersoekHistorisk">
        <annotation>
            <documentation xml:lang="no">En liste med eiere.</documentation>
        </annotation>
        <sequence>
            <choice minOccurs="1" maxOccurs="unbounded">
                <element name="feil" type="tns:feil"/>
                <sequence>
                    <sequence>
                        <element minOccurs="1" maxOccurs="1" name="OsName"
                            type="tns:osName" />
                        <element minOccurs="1" maxOccurs="1" name="OsStatusName"
                            type="tns:osStatusName" />
                        <element minOccurs="1" maxOccurs="1" name="OsStatusDetName"
                            type="tns:ArrayOfOsStatusDetName" />
                    </sequence>
					<element minOccurs="1" maxOccurs="1" name="Eierskap"
						type="tns:Eierskap" />
				</sequence>
            </choice>
        </sequence>
    </complexType>

    <complexType name="Baatsoek">
        <annotation>
            <documentation xml:lang="no">En liste med båter.</documentation>
        </annotation>
        <sequence>
            <choice minOccurs="1" maxOccurs="unbounded">
                <element name="feil" type="tns:feil"/>
                <sequence>
					<element minOccurs="1" maxOccurs="1" name="OsVessel"
						type="tns:osVessel" />
					<element minOccurs="1" maxOccurs="1" name="OsStatusVessel"
						type="tns:osStatusVessel" />
					<element minOccurs="1" maxOccurs="1" name="OsStatusDetVessel"
						type="tns:ArrayOfOsStatusDetVessel" />
                </sequence>
            </choice>
        </sequence>
    </complexType>

	<complexType name = "Avtaler">
		<sequence>
			<choice minOccurs="1" maxOccurs="unbounded">
                <element name="feil" type="tns:feil"/>
                <sequence>
					<element minOccurs="0" maxOccurs="1" name="OsContract"
							type="tns:osContract" />
					<element minOccurs="0" maxOccurs="1" name="OsStatusContract"
							type="tns:osStatusContract" />
					<element minOccurs="0" maxOccurs="1" name="OsStatusDetContract"
							type="tns:ArrayOfOsStatusDetContract" />
                </sequence>
            </choice>
		</sequence>
	</complexType>

	<element name = "Avtaler" type = "tns:Avtaler" /> 
	 
	



    <complexType name="Motorsoek">
        <annotation>
            <documentation xml:lang="no">En liste med motorer.</documentation>
        </annotation>
        <sequence>
            <choice minOccurs="1" maxOccurs="unbounded">
                <element name="feil" type="tns:feil"/>
                <sequence>
					<element minOccurs="1" maxOccurs="1" name="OsMotor"
						type="tns:osMotor" />
					<element minOccurs="1" maxOccurs="1" name="OsStatusMotor"
						type="tns:osStatusMotor" />
					<element minOccurs="1" maxOccurs="1" name="OsStatusDetMotor"
						type="tns:ArrayOfOsStatusDetMotor" />
                </sequence>
            </choice>
        </sequence>
    </complexType>

    <complexType name="feil">
        <sequence>
            <element name="feilkode" type="tns:feilkode"/>
            <element name="feilmelding" type="string"/>
        </sequence>
    </complexType>

    <simpleType name="feilkode">
        <restriction base="string">
            <enumeration value="1">
                <annotation>
                    <documentation xml:lang="no">Søket var ikke unikt.</documentation>
                </annotation>
            </enumeration> 
            <enumeration value="4">
                <annotation>
                    <documentation xml:lang="no">Ingen båt-/eierhistorikk funnet.</documentation>
                </annotation>
            </enumeration> 
        </restriction>
    </simpleType>
</schema>
