Sending objects to server with gson
===

I'm trying to send a java object in json format with the library Gson to a php script but the script doesn't seem to receive the datas ... here is my code :


	public static String syncAddTaskOnline(TaskAddress addr, long onlinePIID){
 
		String donnees = "l'objet addr est null";
 
		if (addr == null){
			return donnees;
		}
		else{
 
			String result = null;
			InputStream is = null;
 
			ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
 
			Gson gson = new Gson();
 
			// convert java object to JSON format,
			// and returned as JSON formatted string
			String jsonAdd = gson.toJson(addr);
 
			System.out.println(jsonAdd);
 
			nameValuePairs.add(new BasicNameValuePair("addr", jsonAdd));			
			nameValuePairs.add(new BasicNameValuePair("onlinePIID", String.valueOf(onlinePIID)));
 
			try {
				HttpClient httpclient = new DefaultHttpClient();
				HttpPost httppost = new HttpPost("http://192.168.1.13/spotnshare/syncAddressPIOnline.php");
				httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
				HttpResponse response = httpclient.execute(httppost);
 
...

my System.out.println(jsonAdd); shows ==> System.out(27192): {"address":"Avenue BLABLA 130,Woaint-Laert,1200,Belgique","postCode":0,"longitude":3.44838,"id":0,"latitude":40.8462,"number":0}

so I think that his json format is ok before it is send to the server, and as for my php script :


    <?php
     
    /* On verif qu'on a bien recu les 3 données */
    if( isset($_POST['addr']) && isset($_POST['onlinePIID'])) {
     
    	// on se connecte à notre base  pour recuperer les data
    	include("connexion_bdd.php");
     
    	if(connexionBDD() == 1){
     
    		$TaskAddress = $_POST['addr'];
     
    		$jAddress = json_decode($TaskAddress);
     
    		echo(json_encode(array("aaaaa" => $_POST['addr'])));
     
    		$address = $jAddress->address;
    		$lat = $jAddress->latitude; 
    		$long = $jAddress->longitude;

I ve placed an echo because each time I was seeing this error : " Notice: Trying to get property of non-object in C:\wamp\www\spotnshare\syncAddressPIOnline.php on line <i>16</i>" line 17 and 18 too so for ==>

    16 -- $address = $jAddress->address;
    17 -- $lat = $jAddress->latitude;
    18 -- $long = $jAddress->longitude;

And my echo shows me that my object is null in my logcat ==> [{"aaaaa":null] ...what I really don't understand is that I ve already used a very similar code that works perfectly :S
