<?xml version="1.0" encoding="us-ascii"?>
<xs:schema xmlns:faults="http://echo.nasa.gov/echo/v9/faults" xmlns:types="http://echo.nasa.gov/echo/v9/types" elementFormDefault="qualified" targetNamespace="http://echo.nasa.gov/echo/v9/faults" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="AuthorizationFault" type="faults:AuthorizationFault" />
    <xs:element name="InternalFault" type="faults:InternalFault" />
    <xs:element name="DuplicateIdFault" type="faults:DuplicateIdFault" />
    <xs:element name="DataSizeLimitFault" type="faults:DataSizeLimitFault" />
    <xs:element name="InvalidArgumentFault" type="faults:InvalidArgumentFault" />
    <xs:element name="InvalidStateFault" type="faults:InvalidStateFault" />
    <xs:element name="ItemNotFoundFault" type="faults:ItemNotFoundFault" />
    <xs:element name="ParseFault" type="faults:ParseFault" />
    <xs:element name="RemovalFault" type="faults:RemovalFault" />
    <xs:element name="UnsupportedFeatureFault" type="faults:UnsupportedFeatureFault" />
    <xs:element name="ValidationFault" type="faults:ValidationFault" />
    <xs:element name="InvalidURLFault" type="faults:InvalidURLFault" />
    <xs:element name="EchoFault" type="faults:EchoFault" />
    <xs:complexType name="DataSizeLimitFault">
        <xs:annotation>
            <xs:documentation>Thrown to indicate the size limit of data that echo can handle has been exceeded.</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="faults:EchoFault">
                <xs:sequence>
                    <xs:element name="SizeLimit" type="xs:int">
                        <xs:annotation>
                            <xs:documentation>Size limit that was exceeded causing this fault to be thrown</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="InvalidArgumentFault">
        <xs:annotation>
            <xs:documentation>Thrown to indicate that one or more arguments passed were invalid.</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="faults:EchoFault">
                <xs:sequence>
                    <xs:element name="Arguments" type="faults:ListOfArguments">
                        <xs:annotation>
                            <xs:documentation>
                                <p>The list of arguments that were invalid.</p>
                                <p>These arguments are for debugging purposes only. They are
										designed to help client developers by providing contextual
										information from ECHO at the time the exception occurred. The
										information provided may not be directly related to nor mapped
										to arguments passed in to the operation. Therefore a client may
										not want to display these values to a user but rather log them
										for future analysis.</p>
                                <p>The argument names may change in future versions of ECHO and
										are not considered part of the ECHO API.</p>
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="ListOfArguments">
        <xs:annotation>
            <xs:documentation>A list of arguments</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="unbounded" name="Argument" type="faults:Argument" />
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="Argument">
        <xs:annotation>
            <xs:documentation>Used to specify ArgumentName and its value that cause a fault.</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="Name" type="xs:string">
                <xs:annotation>
                    <xs:documentation>The name of the argument or field related to an argument.</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="Value" type="xs:string">
                <xs:annotation>
                    <xs:documentation>The invalid argument value. If the invalid value passed was an empty string then this will be the string "null".</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="InvalidStateFault">
        <xs:annotation>
            <xs:documentation>Indicates that the action by the client would put ECHO into an invalid state and is
					not allowed.</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="faults:EchoFault">
                <xs:sequence>
                    <xs:element name="ObjectName" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>The name of the object that was changing state.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="ObjectState" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>Current state of the object</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="ItemNotFoundFault">
        <xs:annotation>
            <xs:documentation>Thrown when the client attempts to access one or more objects that do not exist.</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="faults:EchoFault">
                <xs:sequence>
                    <xs:element name="Arguments" type="faults:ListOfArguments">
                        <xs:annotation>
                            <xs:documentation>
                                <p>The list of arguments that referrenced not existant objects.</p>
                                <p>These arguments are for debugging purposes only. They are
										designed to help client developers by providing contextual
										information from ECHO at the time the exception occurred. The
										information provided may not be directly related to nor mapped
										to arguments passed in to the operation. Therefore a client may
										not want to display these values to a user but rather log them
										for future analysis.</p>
                                <p>The argument names may change in future versions of ECHO and
										are not considered part of the ECHO API.</p>
                            </xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="ParseFault">
        <xs:annotation>
            <xs:documentation>This exception is thrown to indicate that some value could not be parsed.</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="faults:EchoFault">
                <xs:sequence />
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="RemovalFault">
        <xs:annotation>
            <xs:documentation>Represents an error that occurs during the removal of an object from ECHO.
					Sometimes objects in ECHO may not be removed if other object reference the object
					being removed. If that is not allowed this fault is thrown.</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="faults:InvalidStateFault">
                <xs:sequence />
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="UnsupportedFeatureFault">
        <xs:annotation>
            <xs:documentation>Thrown to indicated that a feature was selected that is not supported. This could
					be because the feature is not yet implemented.</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="faults:EchoFault">
                <xs:sequence />
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="ValidationFault">
        <xs:annotation>
            <xs:documentation>Thrown to indicate that an object in or passed to ECHO is not valid.</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="faults:EchoFault">
                <xs:sequence>
                    <xs:element name="ObjectType" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>The type of the object that was invalid.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element minOccurs="0" name="Guid" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>Optional guid if the object exists in ECHO.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="InvalidURLFault">
        <xs:annotation>
            <xs:documentation>Thrown to indicate that the URL given is either not a valid URL in syntax or the
					expected element at the end of the URL does not exist.</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="faults:EchoFault">
                <xs:sequence>
                    <xs:element name="URL" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>The URL that was invalid.</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="InternalFault">
        <xs:annotation>
            <xs:documentation>Thrown by ECHO when an internal error occurs.</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="faults:EchoFault">
                <xs:sequence />
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="AuthorizationFault">
        <xs:annotation>
            <xs:documentation>Thrown by ECHO when the user specified in the token used to invoke an operation is
					unauthorized to invoke it</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="faults:EchoFault">
                <xs:sequence>
                    <xs:element name="Token" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>The token that was used when invoking the operation</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="DuplicateIdFault">
        <xs:annotation>
            <xs:documentation>Thrown by ECHO when a name of an entity being stored already exists</xs:documentation>
        </xs:annotation>
        <xs:complexContent mixed="false">
            <xs:extension base="faults:EchoFault">
                <xs:sequence>
                    <xs:element name="ArgumentName" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>The name of the enity whose name exists</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                    <xs:element name="Value" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>The duplicate value</xs:documentation>
                        </xs:annotation>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="EchoFault">
        <xs:annotation>
            <xs:documentation>Provides information about the error that occurred during the invocation of an ECHO
					operation</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="ErrorCode" type="xs:string">
                <xs:annotation>
                    <xs:documentation>ECHO operation specific error code</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="OpsMessage" nillable="true" type="xs:string">
                <xs:annotation>
                    <xs:documentation>ECHO Operations specified message. This may be changed over time at the
							discretion of the ECHO Operations team</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="SystemMessage" type="xs:string">
                <xs:annotation>
                    <xs:documentation>ECHO developer team specified error message. Will be constant for each
							error code</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="Timestamp" type="xs:dateTime">
                <xs:annotation>
                    <xs:documentation>Time that the error was encountered. Useful to the echo operations team
							while trying to track the error in the log files</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="ErrorInstanceId" type="xs:string">
                <xs:annotation>
                    <xs:documentation>Unique Identifier assigned to an error returned to the client. This is
							useful to track down the error in the log files</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    
      <xs:simpleType name="SoapMessageValidationFault">
        <xs:annotation>
          <xs:documentation>Fault raised when the incoming SOAP request message fails schema validation. The fault will contain information about the validation failure in the body of the tag. No ECHO error code will be provided because the invalid message is rejected before it is processed by ECHO.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string"></xs:restriction>
    </xs:simpleType>

    <xs:element name="SoapMessageValidationFault" type="faults:SoapMessageValidationFault"/>
</xs:schema>
