on 03-13-2006 4:04 PM
I am unable to create a WebService which contains a Locale Object in the request. I assume its because the java.util.Locale object is not Serializable. Can anyone tell me if there is a work around for this?
Hi,
Make sure your strings for Locale follow these rules...
The language string should be lower-case, two-letter codes as defined by ISO-639.
http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt
The country string should be upper-case, two-letter codes as defined by ISO-3166.
http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html
Or try with some constant Locales like
Locale.CANADA
Locale.US
regards,
Uma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dan,
java.util.Locale is serializable. The reason for this issue is that Locale does not provide a parameterless constructor and no setters for the attributes (it is not a standard javabean). A simple workaround is to pass two strings instead of the whole Locale object in your webservice. One string for the country and one for the language.
regards
Sebastian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.