views:

100

answers:

2

Hi guys,

How you guys usually do i18n in web service? especially XmlRpc. You guys just throw code number (e.g Error 1011 - Password not valid) or what?

[edit]

The project that we worked on consists of 3 tiers: the presentation tier, the business logic tier and data tier, I will call them here the front, mid and back.

The front is written in PHP and it communicates with the mid via web service (XML-RPC). Users can also write their own clients to talk to the mid. The mid is developed in Java, it performs business logic and provides data to the front, it may also throws exception to the front.

Now, we want to make it multi-lingual support (i18n). So, we need input/opinion from you guys here on how we can make it possible in mid tier especially for throws exception to the front.

A: 

You can use ws-i18n for SOAP web services.

Basically you can pass a SOAP header from the client that indicates its international preferences, and use it on the server to provide the appropriate response.

I don't know much abou xmlrpc, but maybe you could use an Accept-Language header to do something similar.

Joe
A: 

Define some protocol, document it well and give it to 'front'-developers. Error codes should be included in the protocol document, together with their meaning - hence the i18n of error messages.

Bozho