3 Replies Latest reply: Sep 11, 2012 9:05 AM by PiotrBazan RSS

    AIA Query operations - how to return no elements?

    PiotrBazan
      Hello,

      I've noticed all query response messages for different EBOs found in AIA metadata are defined following the below pattern (ItemEBO as an example):

      Simple query response:

      <xsd:complexType name="QueryItemResponseEBMType">
           <xsd:complexContent>
                <xsd:extension base="corecom:EBMType">
                     <xsd:sequence>
                          <xsd:element name="DataArea" type="QueryItemResponseDataAreaType"/> <---- one and only one
                     </xsd:sequence>
                </xsd:extension>
           </xsd:complexContent>
      </xsd:complexType>

      List query response:

      <xsd:complexType name="QueryItemListResponseEBMType">
           <xsd:complexContent>
                <xsd:extension base="corecom:EBMType">
                     <xsd:sequence>
                          <xsd:element name="DataArea" type="QueryItemListResponseDataAreaType" maxOccurs="unbounded"/> <---- one or more
                     </xsd:sequence>
                </xsd:extension>
           </xsd:complexContent>
      </xsd:complexType>

      As shown above the schema force responses to always contain at least one DataArea.

      But what if a queried resource returns no results ? What should be returned in a response? It looks to me a business fault is the only solution here but it doesn't seem to be the right solution for most cases.

      Thanks,
      Piotr

      Edited by: Piotr Bazan on Jul 18, 2012 6:44 AM