This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 12112 - Enum: MaxCharacters behavior is ambiguous
Summary: Enum: MaxCharacters behavior is ambiguous
Status: CLOSED REMIND
Alias: None
Product: WS-Resource Access
Classification: Unclassified
Component: Enumeration (show other bugs)
Version: CR
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: notifications mailing list for WS Resource Access
QA Contact: notifications mailing list for WS Resource Access
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-17 17:42 UTC by Nathan Burkhart
Modified: 2011-09-13 21:28 UTC (History)
1 user (show)

See Also:


Attachments
proposal (335.50 KB, application/msword)
2011-02-25 22:20 UTC, Doug Davis
Details

Description Nathan Burkhart 2011-02-17 17:42:13 UTC
The WS-Enumeration spec says the following about the processing of the MaxCharacters element in Section 4.1:

"It can happen that the next item the data source would return to the consumer is larger than MaxCharacters. In this case, the data source MAY skip the item, or MAY return an abbreviated representation of the item that fits inside MaxCharacters. If the data source skips the item, it MAY return it as part of the response to a future Enumerate request with a larger value of MaxCharacters, or it MAY omit it entirely from the enumeration. If the oversized item is the last item to be returned for this enumeration context and the data source skips it, it MUST include the wsen:EndOfSequence item in the Enumerate response and invalidate the enumeration context."

The text says that a skipped item MAY be returned in response to a subsequent Enumerate request with the same Context.  This implies that when the element(s) get skipped the EnumerateResponse would contain a valid Context and *no* EndOfSequence element.  However, it says that if the "last item to be returned" is skipped then the EnumerateResponse MUST contain the EndOfSequence element and invalidate the Context (so a future Enumerate response could not come back and retrieve it).

Assume an enumeration has two elements that each take up ~50 characters, and Maxcharacters==75 and MaxElements==10.  There are two interpretations that both appear to be valid according to the spec:

1. Return one item along with an EndOfSequence element.  The second item can never be retrieved.

2. Return one item. Leave the second item to be returned in response to a subsequent Enumerate request.

The first interprets the "last item to be returned" as literally the last in a sequence of items.  The second interprets the spec to say that if there are items left but an Enumerate request fails to retrieve any of them, in that case it will return the EndOfSequence (because the assumption is that the next Enumerate request would retrieve more items).

Both sound like reasonable interpretations -- the spec should make it clear if beahavior #1, behavior #2, or both are valid implementations.
Comment 1 Nathan Burkhart 2011-02-17 23:25:18 UTC
Proposal to amed the second part of that paragraph:


"It can happen that the next item the data source would return to the consumer is larger than MaxCharacters. In this case, the data source MAY skip the item, or MAY return an abbreviated representation of the item that fits inside MaxCharacters. If the data source skips the item, it MAY return it as part of the response to a future Enumerate request with a larger value of MaxCharacters, or it MAY omit it entirely from the enumeration.

If the data source skipped one or more oversized items that can be returned as part of a response to a future Enumerate request, it MUST NOT include the wsen:EndOfSequence item in the Enumerate response.

If all of the skipped items were omitted entirely from the enumeration, the data source MUST include the wsen:EndOfSequence item in the Enumerate response and invalidate the enumeration context.

If all items are skipped so that there are zero items in the Enumerate response, the data source MUST include the wsen:EndOfSequence item in the Enumerate response and invalidate the enumeration context."
Comment 2 Nathan Burkhart 2011-02-17 23:38:39 UTC
Slightly amended proposal to switch paragraph order (zero items in response first) and to clarify the case where all skipped items are omitted:

"It can happen that the next item the data source would return to the consumer
is larger than MaxCharacters. In this case, the data source MAY skip the item,
or MAY return an abbreviated representation of the item that fits inside
MaxCharacters. If the data source skips the item, it MAY return it as part of
the response to a future Enumerate request with a larger value of
MaxCharacters, or it MAY omit it entirely from the enumeration.

If all items are skipped so that there are zero items contained in the Enumerate
response, the data source MUST include the wsen:EndOfSequence item in the
Enumerate response and invalidate the enumeration context.

If the data source skipped one or more oversized items that can be returned as part of a response to a future Enumerate request, it MUST NOT include the wsen:EndOfSequence item in the Enumerate response.

If all of the skipped items were omitted entirely from the enumeration and there are no items left to return as part of a response to a future Enumerate request, the data source MUST include the wsen:EndOfSequence item in the Enumerate response and invalidate the enumeration context."
Comment 3 Doug Davis 2011-02-25 22:20:34 UTC
Created attachment 961 [details]
proposal
Comment 4 Robert Freund 2011-03-22 19:37:34 UTC
proposal accepted as submitted