Title: Web Services: I18N
1Web Services I18N
- A progress report, or, are we done yet?
32nd Internationalization and Unicode Conference
2Presenter
- Addison PhillipsGlobalization ArchitectLab126C
hair W3C Internationalization Core WG
3Agenda
- Web services vs. Internationalization
- Where are we? How did we get here?
- W3C WS-I18N
- SOAP, WS-Policy, and all that
- REST, AJAX, and that Web 2.0 thing
- The other Web services
4About This Presentation
- Web service constraints and capabilities
Internationalization makes a good use case. - The classic internationalization model
- Applying the internationalization model to Web
services - Why constraints? Why capabilities?
5W3C Internationalization Activity
- W3C WSTF
- Web Services Internationalization Usage Scenarios
- Web Services Internationalization Requirements
- W3C Internationalization Core WG
- WS-I18N (Note track)
6Web Services and Internationalization
- So Web Services are internationalized, right?
- Locale-neutral representation (XML Schema)
- No user interface (machine-to-machine)
- Inherits XMLs rich support for Unicode, language
tags, and so forth - Internationalization is the problem of the
service author, not the provider.
7Programming Paradigms
- Desktop
- Locales in the environment
- Web Application
- Locale-related APIs and state mechanisms
- Web Service???
- Uh
the classic I18N model
8Classic SOAP-RPC Web Services
9WS-Policy
- Define service capabilities and constraints via
policy assertions. - Use different features together to get different
results. - Services advertise policies consumers specify
requirements
10What sort of policies for I18N?
- Four Patterns
- Locale Neutral
- Service Determined
- Client Influenced
- Data/Resource Driven
11What does that service do?
- Services generally run in the host locale
- May not be the same as the service provider
- May not give the results the user expects
- No way for the user to control it
- Developers must program services to provide
international capabilities - Provide the locale modelprovide for inputs that
indicate the locale in some (usually proprietary)
manner - E.g. Define multiple endpoints for different
locales - Provide for localization where appropriatedetermi
ne the language to use for the interaction - Providers do nothing for you.
12Web Service Descriptions
- Exchange a locale that is explicitly in the
service signature. - No standards exist for doing this
- Strong platform and programming language
dependency - Exchange a locale that is implied in the
services operation. - Web service descriptions dont convey this
information. - Describe how a particular endpoint will work.
- There may be multiple endpoints in multiple
geographies.
13Invocation
- Language negotiation
- Services still need human readable messages.
- Faults (exceptions, errors) need human readable
messages. - Service may retrieve, process, store, or
otherwise access text. - Locale negotiation
- Making the service do what the user wants.
- Collation, calendar, text processing, currency,
routing, addressing, formatting, business rules,
tax authority, legal requirements, etc.
14Basic Conclusions
- Web services need international preferences
- Personally these are locales
- Web service descriptions need to describe
policies - This service runs in the fr-FR locale.
- The requester can tell me what locale to use.
- If you request a locale I dont support, I
return a Fault message. - Locale identifiers are needed.
- You can tell me what locale to run in if we can
agree on what the identifier means. - Web service discovery needs more
internationalization.
15Constraints and Capabilities
- Internationalization model describes
capabilities - Policy? Runtime locale? Etc.
- Internationalization model describe constraints
- Available locales
- Available resources
- Available language content
- Runtime restrictions
16WS-I18N
- Currently a W3C draft eventual status Working
Group Note - Provides for basic internationalization
properties - Service locale (via IETF BCP 47 language tags)
- Time zone (via Olsen identifiers)
- Can provide additional, service-specific
preferences - Currently via LDML (best choice?)
17Issues
- I wrote it in a day
- Language/locale should be in terms of BCP 47
language priority lists - Language/locale negotiation needs to be provided
for - Separate language from locale?
- Use LDML?
- http//www.w3.org/TR/ws-i18n/
18Examples
19WS-I18N in SOAP Message
- lti18ninternational ... Sactor"..."gt
- lti18nlocalegt locale identifier lt/i18nlocalegt
- lti18ntimezonegt time zone value lt/i18ntimezonegt
- lti18npreferences ...gt
- LDML-based or other locale preferences
- lt/i18npreferencesgt
- lt/i18ninternationalgt
locale identifier LDML (BCP47) neutral
default time zone value RFC 822 offset
Olson id
20(continued)
- lti18ninternationalgt
- lti18nlocalegten-USlt/i18nlocalegt
- lti18npreferencesgt
- ltldmlcollationgt
- ltldmlalias source"de-DE" type"phonebook"/gt
- lt/ldmlcollationgt
- lt/i18npreferencesgt
- lt/i18ninternationalgt
21WS-I18N in WSDL 2.0
- 1 ltwsdldescription 2 targetNamespace"http//tns
.example.com/" 3 xmlnstns"http//tns.example.co
m/" 4 xmlnswsdl"http//www.w3.org/ns/wsdl" 5
xmlnswsp"http//www.w3.org/ns/ws-policy" 6
xmlnsi18np"http//www.w3.org/2008/04/ws-i18np"gt
7 ltwspPolicy xmlid"MyPolicy" gt 8
lti18npi18n/gt 9 lt!-- omitted assertions --gt 10
lt/wspPolicygt 11 lt!-- omitted elements --gt 12
ltwsdlbinding name"MyBinding" type"tnsMyInterfa
ce" gt 13 ltwspPolicyReference 14 URI"MyPolicy"
15 wsdlrequired"true" /gt 16 lt!-- omitted
elements --gt 17 lt/wsdlbindinggt 18
lt/wsdldescriptiongt
22(continued)
- 7 ltwspPolicy xmlid"MyPolicy" gt
- 8 lti18npi18n/gt
- 9 lt!-- omitted assertions --gt
- 10 lt/wspPolicygt
- lti18ninternationalgt
- lti18nlocalegten-USlt/i18nlocalegt
- lti18npreferencesgt
- ltldmlcollationgt
- ltldmlalias source"de-DE" type"phonebook"/gt
- lt/ldmlcollationgt
- lt/i18npreferencesgt
- lt/i18ninternationalgt
- lti18ninternationalgt
- lti18nlocalegten-US,fr,zh-cmn-Hant-CN
lt/i18nlocalegt - lti18npreferencesgt
- ltldmlcollationgt
- ltldmlalias source"de-DE" type"phonebook"/gt
- lt/ldmlcollationgt
- lt/i18npreferencesgt
- lt/i18ninternationalgt
23Schedule
- If you can call it a schedule!
- Likely to be published this year, if we can get
help completing the document.
24REST the other Web services
- Resource oriented rather than RPC
- Nouns, not verbs
- Light-weight simple path-oriented
- Search-engine friendly
- Often technology behind AJAX and Web2.0
- XmlHttpRequest
25REST and I18N
- Alas, the same problemmaybe more acutely
- AJAX often used to directly update the screen
(so needs to be preformatted, in proper
language) - JavaScript has no locale object or locale model
(cant control how it does formatting) - Static user interface determined by a Web
server, not by local configuration (so might get
multiple languages on one page) - No standards whatsoever!
26HTTP Accept-Language
- A poor-mans locale negotiation tool
Accept-Languageen-USq1.0,cmn-Hant-CNq0.8,fr-C
Aq0.6
en
BCP 47 (RFC 4647) Lookup Algorithm
available content
27Time and Time Zone
- Most services are not time zone affected.
- See http//www.w3.org/TR/2005/NOTE-timezone-200510
13/ - Update pending for this document
- Avoidance usually preferable to using zone data
- but sometimes you need a zone offset
- and sometimes you really need a time zone
Zone Noon GMT, 16 July Noon GMT, 16 Dec
America/New_York 800 (DST) 700
America/Santiago 800 900 (DST)
America/Guyana 800 800
28Building an internationalized REST service
- Use Accept-Language and BCP 47 Lookup to
negotiate language/locale - Define custom headers when necessary. Document
these well.
29The REST URI Path dilemma
- How to find stuff in a REST environment
- example.org host (server)
- /users/ path (taxonomy)
- addison resource (e.g. user id)
http//example.org/users/addison
http//example.org/sports/football/Monarcas_Moreli
a/ players/Luis_Ángel_Landín
http//??.??/sports/football/Monarcas_Morelia/ pl
ayers/Luis_Ángel_Landín
30An Example Amazon S3 Service
31Summary
- WS-I18N
- A work in progress you can contribute to.
- Uses WS-Policy to enable SOAP-based Web services
with locale and other international preferences. - REST
- Needs Best Practices better if everyone
identifies locale, language, and international
preferences in the same way. - Needs LTLI?
32Questions? and Comments!