Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/02/2012, 11:18
abraham0189
 
Fecha de Ingreso: enero-2012
Mensajes: 3
Antigüedad: 12 años, 3 meses
Puntos: 0
Pregunta deserializar json!!

Tengo un web service que me manda una cadena json que es esta:

Código:
        <string>[{"StringProperty":"0","IntProperty":0,"DoubleProperty":0},{"StringProperty":"1","IntProperty":8,"DoubleProperty":53.98},{"StringProperty":"2","IntProperty":16,"DoubleProperty":107.96}]</string>
y n4ecesito deserializarlo en mi app pero no se como , me he guiado con algunos ejemplos de internet y he llegado a esto:

Código:
public void autor()
    {
        
          SoapObject solicitud = new SoapObject(namespace, Metodo_getbookautor);
          SoapSerializationEnvelope envoltorio = new SoapSerializationEnvelope(SoapEnvelope.VER11);
          envoltorio.dotNet = true;
          envoltorio.setOutputSoapObject(solicitud);
          HttpTransportSE transporte = new HttpTransportSE(url);
          
          try { 
               transporte.call(accionSoap_autor, envoltorio);
               ///////////////
                Object result = (Object)envoltorio.getResponse();
              
                JSONString=result.toString();
               try{
                   jObject= new JSONObject(JSONString);
                   jArray=jObject.getJSONArray("WebService");
                   for (int i=0;i<jArray.length();i++)
                   {
                   JSONObject json_data= jArray.getJSONObject(i);
                   
                   resultString= json_data.getString("StringProperty")+ " "
                                +json_data.getString("IntProperty")+ " "
                               +json_data.getString("DoubleProperty");
                   }
                   }
               catch (Exception e){
                   e.printStackTrace();
               }
pero cuando llega a jObject= new JSONObject(JSONString);
con debug jObject me da null y ya no hace lo demas, pero la verdad no se si eso este bien puesto que no se como es eso de la serializacion y deserializacion