How to use additional attributes in web service update (DTO) messages?

BACKGROUND

Suppose you have a (SOAP) web service, BookServicebook management library. The information model assumes that the object Bookhas the following attributes:

  • id
  • author
  • publisher
  • title
  • shelfId

Four web service operations are defined for data management:

  • AddBook
  • GetBook
  • UpdateBook
  • DeleteBook

The request and response message are defined for each operation. However, the design of XML update message schemas is more complex. We would like to achieve the following qualities:

  • R1: ability to reset / delete previous attribute values. For instance. say that you will no longer store the book in the library and thereby want to reset / empty / delete the attribute attribute value shelfIdfor this particular book.
  • R2: chattiness -. . - Chatty Services.
  • R3: Concurrency . ( ) .

, , () :

  • -. ( minOccurs="0" ) , , .. <shelfId xsi:nil="true"/>, .
  • .
    • -, , , . : <author dirty="true">Hemingway<author/>. , , .
    • , id, minOccurs="0". , . left-out . , XML NULL. : <shelfId xsi:nil="true"/>.
    • -, . , .
  • . UpdateBook , , , , , . UpdateBookAuthor, UpdateBookPublisher .. , NULL XML, . <shelfId xsi:nil="true"/>.

Alt 3 , , , Book . "" (. R3 ), .

Alt 2 , Alt 1, Alt 2, Concurrency :

  • , / (, authorVersion) = > Alt 2 , author publisher, Book .
  • , / Book = > Alt 2 Alt 1. , .
  • , Concurrency / = > Alt 2 , Alt 1 , .

, Alt 2 ( Alt 3) Alt 1. Book. , , , , () , .

Alt 2.3, , , .

, , Alt 2.2 . , XML , , NULL, . <shelfId xsi:nil="true"/>.

? , ? ?

+2
1

, 2.2 . minoccurs = 0 nil ( ). , , , , .

etag , . , . , .

Alt 1 , , /, , ( imho), .

, - , , , .

, alt 1.

+1

All Articles