Hi! I am new to web services and I need to develop one that returns some text that depends on the laguage of the client. Can someone tell me please how can I do that using jax-ws? (I am using sun's metro framework stack)
The SOAP request could simply include an element stating the preferred language code (ISO 639) and possibly the country code (ISO 3166) to determine the locale that needs to be used.
There is a working draft for Web Services Internationalization (WS-I18N). I'm not aware that this is supported out-of-the-box (the draft hasn't been finalized in the last 2+ years). [ March 23, 2008: Message edited by: Peer Reynders ]
Originally posted by Esteban Puertas: Do you think is a good idea to use the Accept-language http header
That would be an acceptable solution for a REST web service.
It would not an acceptable solution for a SOAP web service as the information wouldn't be inside the SOAP envelope (or WSDL description). For a SOAP web service the language/country code should be part of the SOAP request and possibly the SOAP response. You can always base your solution on the above WS-I18N working draft.
Internationalization isn't as big a priority with SOAP web services as it is with web pages as web services are consumed by other applications - not humans. In most cases normalized "generic data" is exchanged which is displayed on the client using the client's locale. SOAP web services exchanging localized text are pretty much in the minority. [ March 24, 2008: Message edited by: Peer Reynders ]
machines help you to do more, but experience less. Experience this tiny ad: