S90-02A · Question #95
I would like to add two different WS-Policy definitions to my SOAP-based Web service and I would like to give the service consumer the choice to comply to either policy. How can I do this? Select…
The correct answer is B. Create the two separate policies and group them in a policy alternative that is then associated. Option B is correct because WS-Policy defines the concept of policy alternatives - a mechanism where multiple <wsp:Policy> definitions are grouped inside a <wsp:ExactlyOne> element, signaling to the service consumer that it must satisfy exactly one of the listed policies. This…
Question
I would like to add two different WS-Policy definitions to my SOAP-based Web service and I would like to give the service consumer the choice to comply to either policy. How can I do this? Select the correct answer.
Options
- ACreate a separate XML schema for each policy and attach both XML schemas to the service's
- BCreate the two separate policies and group them in a policy alternative that is then associated
- CCommunicate each policy through a separate WS-Addressing SOAP header and let the service
- DYou cannot do this.
How the community answered
(32 responses)- A3% (1)
- B78% (25)
- C6% (2)
- D13% (4)
Explanation
Option B is correct because WS-Policy defines the concept of policy alternatives - a mechanism where multiple <wsp:Policy> definitions are grouped inside a <wsp:ExactlyOne> element, signaling to the service consumer that it must satisfy exactly one of the listed policies. This gives consumers a genuine choice between, for example, using username-token authentication or certificate-based security.
Option A is wrong because XML schemas describe data structure, not behavioral policies - attaching schemas does nothing to express or enforce service-level security or quality-of-service constraints. Option C is wrong because WS-Addressing headers handle message routing and endpoint identification, not policy negotiation or selection. Option D is wrong because WS-Policy was specifically designed to support this use case through policy alternatives.
Memory tip: Think of <wsp:ExactlyOne> as a menu - the service lists its "policy alternatives" and the consumer picks one dish. If it were <wsp:All>, the consumer would have to eat everything.
Topics
Community Discussion
No community discussion yet for this question.