Handle Timezone and Locale In the Determinations API
All policy models have a timezone and a default language. If translations are available for a policy model, a non-default locale may be selected when interacting with a web service. Note that the timezone for a policy model cannot be changed or overridden.
Determinations API web services use the web services internationalization (WS-I18N) specification to specify locale and timezone information in SOAP headers.
The locale
element specifies the locale and the tz
element specifies the timezone.
All responses include both the locale and timezone for the current request.
An example WS-I18N SOAP header is shown below:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:i81n="http://www.w3.org/2005/09/ws-i18n" xmlns:typ="http://oracle.com/determinations/server/12.2/server/types">
<SOAP-ENV:Header>
<ii8n:international>
<i18n:locale>en_US</i81n:locale>
<i18n:tz>Australia/Sydney</i81n:tz>
</i81n:international>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<!-- contents... -->
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
For requests, the meaning of supplying a locale and timezone is described below.
i18n:locale
The locale
element is optional in requests. The locale is a two letter ISO 693-1 language code followed by the two letter ISO 3166-1 country code separated by an underscore (‘_’).
Treatment of the locale
element depends on the web service:
- Server service: If specified in the request it is ignored. The locale for the server service is always 'en-US'.
- Assess, answer and interview services: The locale describes the language in which attribute text, screen text and other translatable strings are returned. If specified in the request determines the translation language to use. The locale must match one of the available translations for the policy model. If no locale is specified, the default policy model language is used.
The list of available languages for a given policy model can be discovered by using the server service's ListRulebases action.
i18n:tz
The tz
element is optional in all requests. If a tz
element is included, or a timezone is specified in any DateTime value, the timezone must match the time zone reported by the server. Using any other timezone will cause an error.
The timezone for a policy model can be determined by making a ListRulebases request.
Tip: It is preferable to specify the time zone as an Olsen ID (for example, Australia/Sydney
) rather than in the RFC822 format (for example, GMT+10:00
). This will avoid the provided timezone being rejected by the server during periods of daylight savings.