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:element name="DataArea" type="QueryItemResponseDataAreaType"/> <---- one and only one
List query response:
<xsd:element name="DataArea" type="QueryItemListResponseDataAreaType" maxOccurs="unbounded"/> <---- one or more
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.
Edited by: Piotr Bazan on Jul 18, 2012 6:44 AM
To handle this, you just to need place empty <DataArea> as below when the service provider returns no results for the query.
Let me know if you have any queries.
Edited by: Rahul on Aug 31, 2012 3:33 AM
thanks for your input.
Returning an empty DataArea creates a need for an extra check on the client site (not a big deal maybe). Wouldn't it be more natural to return no DataArea (not allowed by the current schema) at all or throw a business exception (not all cases are business exceptions)?
Is there a purpose for restricting its occurence to 'at least 1'?