Policies can be associated with many of the Web services artifacts. This topic will be visited again in the context of security; our first step will be to define a set of application-specific polices for the book-ordering scenario.
For our example scenario, the following policies apply and must be formally specified:
The endpoint is down for maintenance each Sunday morning from midnight until 2:00 AM.
Orders must be received within 30 minutes of their timestamp. Orders delayed in transmission more than 30 minutes will be discarded, and the application may return a Fault.
US dollars and euros are the currencies supported by the service.
These policies can be formally defined using WS-Policy's policy assertions. WS-Policy does not specify the exact syntax to be used but instead provides an extensible framework for various policy languages. In our example, we show a set of policy assertions that would be proprietary to our order service.
Custom Policy Assertions (01) <msp:EndpointMaintenanceSchedule> (02) <msp:Unavailable day="Sunday" start="0000" end="0200"/> (03) </msp:EndpointMaintenanceSchedule> (04) <msp:MessageFormat> (05) <msp:DeliveryDelay message="msp:PurchaseOrder" msp:maximum="PT30S"/> (06) </msp:MessageFormat> (07) <msp:Currency>USD</msp:Currency> (08) <msp:Currency>EUR</msp:Currency>