<?xml version = "1.0" encoding = "UTF-8"?>

<!--$Header: /cvsroot/ebxmlrr/ebxmlrr-spec/misc/2.5/schema/rs.xsd,v 1.2 2003/06/04 18:17:42 farrukh_najmi Exp $-->
<schema xmlns = "http://www.w3.org/2001/XMLSchema"
	 targetNamespace = "urn:oasis:names:tc:ebxml-regrep:rs:xsd:2.5"
	 xmlns:tns = "urn:oasis:names:tc:ebxml-regrep:rs:xsd:2.5"
	 xmlns:rim = "urn:oasis:names:tc:ebxml-regrep:rim:xsd:2.5" 	 
	>
	<annotation>
		<documentation xml:lang = "en">The schema for OASIS ebXML Registry Services</documentation>
	</annotation>

	<!-- Import the rim.xsd file with XML schema mappaing from RIM -->
	<import namespace="urn:oasis:names:tc:ebxml-regrep:rim:xsd:2.5" schemaLocation="rim.xsd"/>

	<complexType name = "RegistryRequestType">
		<annotation>
			<documentation xml:lang = "en">
Base type for all ebXML Registry requests
			</documentation>
		</annotation>

                <sequence>
                    <!-- every request may be signed. -->
                    <element ref="rim:SignatureList" minOccurs = "0" maxOccurs="1"/>
                    
                    <!-- every request may be extended using Slots. -->
                    <element name = "RequestSlotList" type="rim:SlotListType" minOccurs = "0" maxOccurs="1"/>
                </sequence>
                
		<!--Needed for async case. In case of sync request/response you may not need id. -->
		<attribute name = "id" use = "optional" type = "anyURI"/>
	</complexType>
		
	<simpleType name = "ErrorType">
		<restriction base = "NCName">
			<enumeration value = "Warning"/>
			<enumeration value = "Error"/>
		</restriction>
	</simpleType>
	<element name = "RegistryErrorList">
		<annotation>
			<documentation xml:lang = "en"> The RegistryErrorList is derived from the ErrorList element from the ebXML Message Service Specification </documentation>
		</annotation>
		<complexType>
			<sequence>
				<element ref = "tns:RegistryError" maxOccurs = "unbounded"/>
			</sequence>
			<attribute name = "highestSeverity" use = "optional" type = "tns:ErrorType"/>
		</complexType>
	</element>
	<element name = "RegistryError">
		<complexType>
			<simpleContent>
				<extension base = "string">
					<attribute name = "codeContext" use = "required" type = "string"/>
					<attribute name = "errorCode" use = "required" type = "string"/>
					<attribute name = "severity" default = "Error" type = "tns:ErrorType"/>
					<attribute name = "location" use = "optional" type = "string"/>
				</extension>
			</simpleContent>
		</complexType>
	</element>

	<complexType name = "RegistryResponseType">
		<annotation>
			<documentation xml:lang = "en">
Base type for all ebXML Registry responses
			</documentation>
		</annotation>

                <sequence>
                    <!-- every response may be signed. -->
                    <element ref="rim:SignatureList" minOccurs = "0" maxOccurs="1"/>
                    
                    <!-- every response may be extended using Slots. -->
                    <element name = "ResponseSlotList" type="rim:SlotListType" minOccurs = "0" maxOccurs="1"/>
                
                    <element ref = "tns:RegistryErrorList" minOccurs = "0"/>
                </sequence>
                <attribute name = "status" use = "required">
                        <simpleType>
                                <restriction base = "NCName">
                                        <enumeration value = "Success"/>
                                        <enumeration value = "Failure"/>
                                        <enumeration value = "Unavailable"/>
                                </restriction>
                        </simpleType>
                </attribute>
                
		<!--id is the request if for the request for which this is a response-->
		<attribute name = "requestId" use = "optional" type = "anyURI"/>
	</complexType>
	<element name = "RegistryResponse" type="tns:RegistryResponseType"/>

</schema>
