[thelist] PHP/Webservice -- send "string as number" or "number as string" ?

Luther, Ron Ron.Luther at hp.com
Tue Nov 11 12:11:47 CST 2008

Stefan Schwarzer asked:

>>I am developing a webservice, in which one needs to specify the type of the parameter

>>I want to sent a country ID,

Hi Stef,

Solution #1 - Use the two character ISO Country Code values and fugettabout using those integer things; http://tinyurl.com/2d22r3

Solution #2 - Write your webservice to handle a 3 character parameter and prepend a blank space to the two character value "AF" or "09" that you used to send.  The leading space (" AF", " 09") should force type to be 'character'.


(If blanks don't work for you, prepend a boatload of "Zed"s.  That will force type.  Then use string commands to strip them back off.  Hopefully, in the language you are using, 'data type' should be sticky.)

More information about the thelist mailing list