Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is the difference between Optional and Ignorable WS-Policy attributes

 
Kamal Tripathi
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Quoting from Ivan's notes

The following policy expression requires:
•Addressing.
•Optionally MIME-serialization.
• Transport or message-level security. Additionally there is a policy assertion informing clients that the service performs logging of some kind. This policy assertion may be completely ignored, as specified by the wsp:Ignorable attribute.



Don't both mean the same here??
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
First of all, this is the policy expression discussed:


The <All> element means that all contained policies are required (but it is not as simple, so read on! ).
The <mtom:OptimizedMimeSerialization> element says that MIME serialization is required, until we encounter the Optional attribute, which suddenly makes MIME serialization optional. Note that the Optional attribute only affects the MIME serialization policy!
The <wsam:Addressing> element says that addressing is required. Period.
The <log:Logging> element says that logging is required, until we see the Ignorable attribute with a value "true" which tells us that the requirement regarding logging may be ignored. Again, this only affects the policy element in which the Ignorable attribute appears, which is logging.
Then there is an <ExaclyOne> element, which means that exactly one of the policies contained in this element is required.
Hope this clarifies!
Best wishes!
 
Kamal Tripathi
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ivan,

thanks for the reply. However probably my question was not clear. I already understood each policy expression element from your notes. However I was confused how using Optional and Ignorable elements affects each expression. So in this example if we consider the following snippet.



How would it impact the overall policy if I rewrite it like this (note I have switched the attributes)



Point being that if each attribute causes the particular policy to be optional/ignorable (which I am taking means implementer may or may not implement it), why two attributes, why not just one.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic