java - Preserve sort order of SOAP result -
i've built soap service jax-ws, , returns number of sorted results, sorted in order customer finds aesthetically pleasing. i've got handled no problem in end, , results coming through consistently in right order. client piece, being generated wsimport, using arraylists when receives these results, not guaranteed preserve order when iterated. there way override this? or better can on soap side in schema tell client needs preserve order?? ( cause know i'm going have c# client )
tia!!
is using arraylists when receives these results, not guaranteed preserve order when iterated.
where assumption come from?
the java.util.list
interface represents ordered collection. order of elements in collection essential. implementation of java.util.list
did not return correct order of elements in collection when iterating breaking contract of interface.
the javadoc list.iterator()
method states (emphasis mine):
returns iterator on elements in list in proper sequence.
the iterator returned arraylist not violate this. returns elements in same order underlying array.
Comments
Post a Comment