Web Services: I18N - PowerPoint PPT Presentation

1 / 32
About This Presentation
Title:

Web Services: I18N

Description:

The classic internationalization model. Applying the internationalization model to Web services ... the classic I18N model 'Classic' SOAP-RPC Web Services. WS-Policy ... – PowerPoint PPT presentation

Number of Views:90
Avg rating:3.0/5.0
Slides: 33
Provided by: Add61
Category:
Tags: i18n | classic | services | web

less

Transcript and Presenter's Notes

Title: Web Services: I18N


1
Web Services I18N
  • A progress report, or, are we done yet?

32nd Internationalization and Unicode Conference
2
Presenter
  • Addison PhillipsGlobalization ArchitectLab126C
    hair W3C Internationalization Core WG

3
Agenda
  • 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

4
About 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?

5
W3C Internationalization Activity
  • W3C WSTF
  • Web Services Internationalization Usage Scenarios
  • Web Services Internationalization Requirements
  • W3C Internationalization Core WG
  • WS-I18N (Note track)

6
Web 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.

7
Programming Paradigms
  • Desktop
  • Locales in the environment
  • Web Application
  • Locale-related APIs and state mechanisms
  • Web Service???
  • Uh

the classic I18N model
8
Classic SOAP-RPC Web Services
9
WS-Policy
  • Define service capabilities and constraints via
    policy assertions.
  • Use different features together to get different
    results.
  • Services advertise policies consumers specify
    requirements

10
What sort of policies for I18N?
  • Four Patterns
  • Locale Neutral
  • Service Determined
  • Client Influenced
  • Data/Resource Driven

11
What 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.

12
Web 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.

13
Invocation
  • 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.

14
Basic 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.

15
Constraints and Capabilities
  • Internationalization model describes
    capabilities
  • Policy? Runtime locale? Etc.
  • Internationalization model describe constraints
  • Available locales
  • Available resources
  • Available language content
  • Runtime restrictions

16
WS-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?)

17
Issues
  • 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/

18
Examples
19
WS-I18N in SOAP Message
  1. lti18ninternational ... Sactor"..."gt
  2. lti18nlocalegt locale identifier lt/i18nlocalegt
  3. lti18ntimezonegt time zone value lt/i18ntimezonegt
  4. lti18npreferences ...gt
  5. LDML-based or other locale preferences
  6. lt/i18npreferencesgt
  7. lt/i18ninternationalgt

locale identifier LDML (BCP47) neutral
default time zone value RFC 822 offset
Olson id
20
(continued)
  1. lti18ninternationalgt
  2. lti18nlocalegten-USlt/i18nlocalegt
  3. lti18npreferencesgt
  4. ltldmlcollationgt
  5. ltldmlalias source"de-DE" type"phonebook"/gt
  6. lt/ldmlcollationgt
  7. lt/i18npreferencesgt
  8. lt/i18ninternationalgt

21
WS-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

23
Schedule
  • If you can call it a schedule!
  • Likely to be published this year, if we can get
    help completing the document.

24
REST 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

25
REST 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!

26
HTTP 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
27
Time 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
28
Building an internationalized REST service
  • Use Accept-Language and BCP 47 Lookup to
    negotiate language/locale
  • Define custom headers when necessary. Document
    these well.

29
The 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
30
An Example Amazon S3 Service
31
Summary
  • 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?

32
Questions? and Comments!
Write a Comment
User Comments (0)
About PowerShow.com