<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xvergabe-if-svc="http://xvergabe.org/xsd/client-interface/service/4" xmlns:xvergabe-docs="http://xvergabe.org/documents/xsd/4" xmlns:xvergabe-if="http://xvergabe.org/interface/xsd/4" targetNamespace="http://xvergabe.org/xsd/client-interface/service/4" version="4.0" elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xs:import schemaLocation="./xvergabe-documents.xsd" namespace="http://xvergabe.org/documents/xsd/4" />
  <xs:import schemaLocation="./xvergabe-messages.xsd" namespace="http://xvergabe.org/interface/xsd/4" />
  <xs:import schemaLocation="./xvergabe-datatypes.xsd" namespace="http://xvergabe.org/interface/xsd/4" />
  <xs:complexType name="AbstractResponse" abstract="true">
    <xs:annotation>
      <xs:documentation>Abstract response type providing general information about the status of the response. All responses in this web service extend from this type.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="responseStatus" type="xvergabe-docs:ResponseDocumentType">
        <xs:annotation>
          <xs:documentation>ResponseDocument containing information about the status of the response (error, warning, etc.).</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="redirectUrl" minOccurs="0" type="xs:anyURI">
        <xs:annotation>
          <xs:documentation>If the server does not support direct subscription to a tendering procedure the server MAY provide a URL in this field that points to a web application that provides this functionality or displays a text explaining how to subscribe.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="MessageSelector">
    <xs:annotation>
      <xs:documentation>Parameters that define constraints for the selection of a set of messages.</xs:documentation>
    </xs:annotation>
    <xs:choice>
      <xs:element name="messageID" type="xvergabe-if:GUID">
        <xs:annotation>
          <xs:documentation>The unique ID of the single message to return. If this ID is specified, the server MUST return only this one message or create an error response if it does not exist.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:sequence>
        <xs:element name="tenderingID" type="xvergabe-if:GUID">
          <xs:annotation>
            <xs:documentation>The unique ID of the tendering procedure for which messages shall be returned. If only this ID is specified, the server MUST return all messages for the client concerning this tendering procedure.</xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="lastKnownMessageID" minOccurs="0" type="xvergabe-if:GUID">
          <xs:annotation>
            <xs:documentation>The unique ID of the latest message that the client has received in previous message exchanges. If this ID is specified, the server MUST return only the messages that were generated AFTER the message identified by this ID.</xs:documentation>
          </xs:annotation>
        </xs:element>
      </xs:sequence>
    </xs:choice>
  </xs:complexType>
  <xs:complexType name="msgTypeGetDocumentRequest">
    <xs:annotation>
      <xs:documentation>A request from the client to the server to download a specific document.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="ID" type="xvergabe-if:GUID">
        <xs:annotation>
          <xs:documentation>The unique ID of the requested document. This ID should have been provided by the server in a previous message exchange.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="msgTypeGetDocumentResponse">
    <xs:annotation>
      <xs:documentation>A response to a GetDocumentRequest.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="xvergabe-if-svc:AbstractResponse">
        <xs:sequence>
          <xs:element name="document" minOccurs="0" type="xvergabe-if:Attachment">
            <xs:annotation>
              <xs:documentation>The requested document.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="msgTypeGetMessagesRequest">
    <xs:annotation>
      <xs:documentation>A request from the client to the server to get messages that are available for a specified tendering procedure.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="parameter" type="xvergabe-if-svc:MessageSelector">
        <xs:annotation>
          <xs:documentation>The parameters defining which messages to include in the response. The client can specify either a single message or a set of messages from a specified tendering procedure.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="msgTypeGetMessagesResponse">
    <xs:annotation>
      <xs:documentation>A response to a GetMessagesResponse.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="xvergabe-if-svc:AbstractResponse">
        <xs:sequence>
          <xs:element name="responseMessageOrderNumber" type="xs:nonNegativeInteger">
            <xs:annotation>
              <xs:documentation>Sequence number of a message within the set of messages contained in this response. The sequence number MUST be in chronological order of the date the message was created.</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="message" minOccurs="0" maxOccurs="unbounded" type="xvergabe-if:AbstractServerMessage">
            <xs:annotation>
              <xs:documentation>The actual message.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="msgTypeGetOSCITransferIDRequest">
    <xs:annotation>
      <xs:documentation>A request from the client to the server to obtain a messageID in order to transfer the offer, participation request or withdrawal via OSCI Transport to the platform. 
The client uses the ID delivered in the response as the subject in the OSCI message delivering the object in question. The platform SHALL pull messages / delivery receipts from the OSCI intermediary based on the ID / subject and thus create a link between the delivered object and the ID. 
This MUST be the first step in the scenario delivering the object in question via OSCI-Transport. 
A platform not supporting OSCI-Transport MUST send an ERROR-Response back to the client.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="xvergabe-if:OSCITransferIDRequestType" />
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="msgTypeGetOSCITransferIDResponse">
    <xs:annotation>
      <xs:documentation>a servers response to a getOSCITransferIDRequest. Includes the TransferID issued by the server. MAY be omitted if there is a error (e.g. when the platform does not support OSCI Transport or if the objectID for the withdrawal request is not known to the platform). 
When an error occurs, an error message MUST be present in the response. In case the OSCITransferIDRequest was initiated in order to sent a withdrawal and the objectID to withdraw was unknown to the platform, the ERROR code (mainResponseCode) must be INVALID_ID.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="xvergabe-if-svc:AbstractResponse">
        <xs:sequence>
          <xs:element name="OSCITransferID" minOccurs="0" type="xvergabe-if:GUID">
            <xs:annotation>
              <xs:documentation>the TransferID issued by the platform. This ID MUST be used as an OSCI-subject in the OSCI-message the client sends to the OSCI intermediary. 
This ID MAY be absent when an error occurs.</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="msgTypeGetTenderIDsRequest">
    <xs:annotation>
      <xs:documentation>A request from the client to the server to list the IDs of the tendering procedure the client has subscribed.</xs:documentation>
    </xs:annotation>
  </xs:complexType>
  <xs:complexType name="msgTypeGetTenderIDsResponse">
    <xs:annotation>
      <xs:documentation>A response to a GetTenderIDsRequest.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="xvergabe-if-svc:AbstractResponse">
        <xs:sequence>
          <xs:element name="procedure" minOccurs="0" maxOccurs="unbounded">
            <xs:annotation>
              <xs:documentation>List containing information about each tendering procedure the client has subscribed to.</xs:documentation>
            </xs:annotation>
            <xs:complexType>
              <xs:sequence>
                <xs:element name="tenderID" type="xvergabe-if:GUID">
                  <xs:annotation>
                    <xs:documentation>The unique ID of the tendering procedure.</xs:documentation>
                  </xs:annotation>
                </xs:element>
                <xs:element name="tenderTitle" type="xvergabe-if:String.1024">
                  <xs:annotation>
                    <xs:documentation>The title of the tendering procedure.</xs:documentation>
                  </xs:annotation>
                </xs:element>
                <xs:element name="lastMessageID" type="xvergabe-if:GUID">
                  <xs:annotation>
                    <xs:documentation>Unique ID of the latest message concerning the tendering procedure that is currently available on the platform for this user.</xs:documentation>
                  </xs:annotation>
                </xs:element>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="msgTypeSendMessageRequest">
    <xs:annotation>
      <xs:documentation>A request that sends a message from the client to the server.</xs:documentation>
    </xs:annotation>
    <xs:choice>
      <xs:element name="inquiryMessage" type="xvergabe-if:ClientInquiryMessageType">
        <xs:annotation>
          <xs:documentation>The message to send to the server.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:choice>
  </xs:complexType>
  <xs:complexType name="msgTypeSendMessageResponse">
    <xs:annotation>
      <xs:documentation>A response to a SendMessageResponse.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="xvergabe-if-svc:AbstractResponse" />
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="msgTypeSendSynchronousMessageRequest">
    <xs:annotation>
      <xs:documentation>A request that sends a message to the server (platform) in a synchronous manner, meaning that the response includes the functional answer from the platform. Only offers, participations and withdrawal-messages MAY be sent in this way.</xs:documentation>
    </xs:annotation>
    <xs:choice>
      <xs:element name="offerMessage" type="xvergabe-if:OfferMessageType">
        <xs:annotation>
          <xs:documentation>the offer message to be sent synchronously. When used in the request the Response MUST include an offerDeliveryReceiptMessage.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="participationMessage" type="xvergabe-if:ParticipationMessageType">
        <xs:annotation>
          <xs:documentation>the participation message to be sent synchronously. When used in the request the response MUST include a participationDeliveryReceiptMessage.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="offerWithdrawalMessage" type="xvergabe-if:OfferWithdrawalMessageType">
        <xs:annotation>
          <xs:documentation>the offer withdrawal message to be sent synchronously. When used in the request the response MUST include an offerWithdrawalDeliveryReceiptMessage.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="participationWithdrawalMessage" type="xvergabe-if:ParticipationWithdrawalMessageType">
        <xs:annotation>
          <xs:documentation>the participation withdrawal message to be sent synchronously. When used in the request the response MUST include a participationWithdrawalDeliveryReceiptMessage.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:choice>
  </xs:complexType>
  <xs:complexType name="msgTypeSendSynchronousMessageResponse">
    <xs:annotation>
      <xs:documentation>the functional/technical response to the synchronous message request. 
When the request used to include an offerMessage then the response MUST include an offerDeliveryReceiptMessage. 
When the request used to include an participationMessage then the response MUST include an participationDeliveryReceiptMessage. 
When the request used to include an offerWithdrawalMessage then the response MUST include an offerWithdrawalDeliveryReceiptMessage. 
When the request used to include an participationWithdrawalMessage then the response MUST include an participationWithdrawalDeliveryReceiptMessage.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="xvergabe-if-svc:AbstractResponse">
        <xs:choice>
          <xs:element name="offerDeliveryReceiptMessage" type="xvergabe-if:OfferDeliveryReceiptMessageType">
            <xs:annotation>
              <xs:documentation>the offerDeliveryReceiptMessage delivered in response to an offerMessage (the request MUST have been an offerMessage).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="participationDeliveryReceiptMessage" type="xvergabe-if:ParticipationDeliveryReceiptMessageType">
            <xs:annotation>
              <xs:documentation>the participationDeliveryReceiptMessage delivered in response to a participationMessage (the request MUST have been a participationMessage).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="offerWithdrawalDeliveryReceiptMessage" type="xvergabe-if:OfferWithdrawalMessageType">
            <xs:annotation>
              <xs:documentation>the offerWithdrawalDeliveryReceiptMessage delivered in response to an offerWithdrawalMessage (the request MUST have been an offerWithdrawalMessage).</xs:documentation>
            </xs:annotation>
          </xs:element>
          <xs:element name="participationWithdrawalDeliveryReceiptMessage" type="xvergabe-if:ParticipationWithdrawalMessageType">
            <xs:annotation>
              <xs:documentation>the participationWithdrawalDeliveryReceiptMessage delivered in response to a participationWithdrawalMessage (the request MUST have been a participationWithdrawalMessage).</xs:documentation>
            </xs:annotation>
          </xs:element>
        </xs:choice>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="msgTypeSubscriptionRequest">
    <xs:annotation>
      <xs:documentation>A request from the client to the server to subscribe messages about a given tendering procedure. After a successful subscription request, the client can call the operation getTenderIDs to obtain messages concerning the specified tendering procedure.</xs:documentation>
    </xs:annotation>
    <xs:choice>
      <xs:element name="tenderID" type="xvergabe-if:GUID">
        <xs:annotation>
          <xs:documentation>The ID of the tendering procedure whose messages to subscribe. A Server MUST support this parameter.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="platformSpecificTenderID" type="xvergabe-if:String.4096">
        <xs:annotation>
          <xs:documentation>The platform specific ID of the tendering procedure whose messages to subscribe. A Server MUST support this parameter since it used for enrollment of the client</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:choice>
  </xs:complexType>
  <xs:complexType name="msgTypeSubscriptionResponse">
    <xs:annotation>
      <xs:documentation>A response to a SubscriptionRequest.</xs:documentation>
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="xvergabe-if-svc:AbstractResponse">
        <xs:sequence>
          <xs:element name="procedure" minOccurs="0">
            <xs:annotation>
              <xs:documentation>List containing information about the tendering procedure the client has subscribed to.</xs:documentation>
            </xs:annotation>
            <xs:complexType>
              <xs:sequence>
                <xs:element name="tenderID" type="xvergabe-if:GUID">
                  <xs:annotation>
                    <xs:documentation>The unique ID of the tendering procedure.</xs:documentation>
                  </xs:annotation>
                </xs:element>
                <xs:element name="tenderTitle" type="xvergabe-if:String.1024">
                  <xs:annotation>
                    <xs:documentation>The title of the tendering procedure.</xs:documentation>
                  </xs:annotation>
                </xs:element>
                <xs:element name="lastMessageID" type="xvergabe-if:GUID">
                  <xs:annotation>
                    <xs:documentation>Unique ID of the latest message concerning the tendering procedure that is currently available on the platform for this user.</xs:documentation>
                  </xs:annotation>
                </xs:element>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element name="msgGetDocumentRequest">
    <xs:annotation>
      <xs:documentation>Root element for a request to the operation getDocument.</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="xvergabe-if-svc:msgTypeGetDocumentRequest" />
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="msgGetDocumentResponse">
    <xs:annotation>
      <xs:documentation>Root element for a response of the operation getDocument.</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="xvergabe-if-svc:msgTypeGetDocumentResponse" />
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="msgGetMessagesRequest">
    <xs:annotation>
      <xs:documentation>Root element for a request to the operation getMessages.</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="xvergabe-if-svc:msgTypeGetMessagesRequest" />
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="msgGetMessagesResponse">
    <xs:annotation>
      <xs:documentation>Root element for a response of the operation getMessages.</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="xvergabe-if-svc:msgTypeGetMessagesResponse" />
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="msgGetOSCITransferIDRequest">
    <xs:annotation>
      <xs:documentation>Root element for a request to the operation getOSCITransferID</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="xvergabe-if-svc:msgTypeGetOSCITransferIDRequest" />
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="msgGetOSCITransferIDResponse">
    <xs:annotation>
      <xs:documentation>Root element for a response to the operation getOSCITransferID</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="xvergabe-if-svc:msgTypeGetOSCITransferIDResponse" />
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="msgGetTenderIDsRequest">
    <xs:annotation>
      <xs:documentation>Root element for a request to the operation getTenderIDs.</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="xvergabe-if-svc:msgTypeGetTenderIDsRequest" />
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="msgGetTenderIDsResponse">
    <xs:annotation>
      <xs:documentation>Root element for a response of the operation getTenderIDs.</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="xvergabe-if-svc:msgTypeGetTenderIDsResponse" />
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="msgSendMessageRequest">
    <xs:annotation>
      <xs:documentation>Root element for a request to the operation sendMessage.</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="xvergabe-if-svc:msgTypeSendMessageRequest" />
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="msgSendMessageResponse">
    <xs:annotation>
      <xs:documentation>Root element for a response of the operation sendMessage.</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="xvergabe-if-svc:msgTypeSendMessageResponse" />
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="msgSendSynchronousMessageRequest">
    <xs:annotation>
      <xs:documentation>Root element for a request to the operation sendSynchronousMessage.</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="xvergabe-if-svc:msgTypeSendSynchronousMessageRequest" />
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="msgSendSynchronousMessageResponse">
    <xs:annotation>
      <xs:documentation>Root element for a response of the operation sendSynchronousMessage.</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="xvergabe-if-svc:msgTypeSendSynchronousMessageResponse" />
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="msgSubscriptionRequest">
    <xs:annotation>
      <xs:documentation>Root element for a request to the operation subscribe. Subsrciption can occur by specifying the XVergabe ID or a (potentially more user friendly) platform specific ID of the tendering procedure.</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="xvergabe-if-svc:msgTypeSubscriptionRequest" />
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="msgSubscriptionResponse">
    <xs:annotation>
      <xs:documentation>Root element for a response of the operation subscribe.</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="xvergabe-if-svc:msgTypeSubscriptionResponse" />
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
</xs:schema>

