I sent a resquest in android to webservice PHP with ksoap2 as:
String NAMESPACE="http://www.localhost:81/wsdl";
String METHOD_NAME="insertUser";
String SOAP_ACTIONS="http://www.localhost:81/wsdl#insertUser";
String URL="http://10.0.2.2:81/phpWebservice/pgsql.php";
SoapObject request=new SoapObject(NAMESPACE, METHOD_NAME);
**request.addProperty("name","地獄");**
request.addProperty("birthday", "2012/02/01");
SoapSerializationEnvelope envelope=new SoapSerializationEnvelope(SoapEnvelope.VER11);
//envelope.dotNet=true;
envelope.setOutputSoapObject(request);
HttpTransportSE androidhttpTranport=new HttpTransportSE (URL);
androidhttpTranport.call(SOAP_ACTIONS, envelope);
Webservicde php as:
require("nusoap.php");
$server = new soap_server();
$server->register('insertUser', // method name
array('name' => 'xsd:string','birthday'=>'xsd:string'), // input parameters
array('return' => 'xsd:int'), // output parameters
$namespace, // namespace
$namespace . '#insertUser', // soapaction
'rpc', // style
'encoded', // use
'Get all user id dua vao =0' // documentation
);
function insertUser($name,$birthday)
{
value of $name=?? Why
}
value of 'name' from android is "地獄" but webserver $name='??' value of $name at webservice is error. Can you help me?
You can encode and decode
String encoded =URLEncoder.encode("地獄", "UTF-8"); at app
String de= URLDecoder.decode(encoded, "UTF-8"); at server