i18n,之前在J2EE里,自然用struts来做。但是Web Service里貌似应该不需要这部分,但是实际上,有些操作还是避免不了要支持多国语言。
查了一圈儿,好像WS-i18n还在working draft的阶段,而且好像已经好几年了……也没找到什么开源中间件的实现。
大意是在SOAP header中加上<i18n:international>相关的标签。
因为毕竟是Web Service,利用http header还是不太妥,还是要放在SOAP里面。
记录一下查到的链接,备用。
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.