最近復習服務計算相關課程,講到SOAP Header屬性里的mustUnderstand屬性。這里簡單的說一下我對mustUnderstand的理解。
在soap中,header是可選項,header由header blocks(header entities)組成。其實header項是可選的,並不是必須的。header讓處於ultimate node之前的intermediaries能夠對信息進行處理。能夠為soap增加事務性的支持,比如路徑啊,認證等等。這些都是用戶自己定義的。
再來說mustUnderstand。mustUnderstand屬性是header三種屬性之一,其他兩個是actor和encodingStyle。關於mustUnderstand,ppt里講“Receiver mode cannot handle mustUnderstand SOAP header block”。我懷疑這里應該是node而不是mode。。。mustUnderstand事實上是對intermediary的要求,要求節點必須能夠處理屬性信息,不然就會返回fault
<env:Body>
<env:Fault>
<faultcode>MustUnderstand</faultcode>
<faultstring>
One or more mandatory headers not understand
</faultstring>
</env:Fault>
</env:Body>
而且不能忽略掉。說到底,mustUnderstand要求中間節點必須能對某一個屬性進行處理。否則就會報錯。
