Respuesta: duda JSON Buenas
Tienes razon con que al usar el print_r si te muestra el valor de la decodificacion. Pero solo de las que estan bien hechas por lo que. Aqui os muestro los resultados antes y despues de decodificar un objeto devuelto por un servicio web de Cloud made: Decoding: {"version":0.3,"status":0,"route_summary":{"total_ distance":1603,"total_time":158,"start_point":"Sä gerstraße","end_point":"Im Gisinger Feld"},"route_geometry":[[47.25946,9.58395],[47.259239,9.58449],[47.258469,9.58625],[47.25769,9.58806],[47.258148,9.58849],[47.258991,9.58929],[47.259319,9.58957],[47.259548,9.5898],[47.259708,9.5901],[47.259789,9.59034],[47.259861,9.59071],[47.259918,9.59088],[47.259769,9.59246],[47.259708,9.59299],[47.259701,9.59367],[47.259682,9.59403],[47.259651,9.59418],[47.25938,9.595],[47.259201,9.59556],[47.259171,9.59569],[47.25914,9.59585],[47.259102,9.59682],[47.259102,9.59689],[47.258991,9.59737],[47.25898,9.59743],[47.258862,9.59792],[47.258709,9.59839],[47.25869,9.59847],[47.258808,9.59861],[47.258881,9.59878],[47.25893,9.59878],[47.25922,9.5988],[47.259548,9.59889],[47.25988,9.59897],[47.26001,9.59902],[47.260201,9.59911],[47.260429,9.59921],[47.260761,9.59938],[47.261009,9.59879]],"route_instructions": [["Head southeast on Sägerstraße",369,0,44,"0.4 km","SE",122.1],["Turn left at L60\/Nofler Straße",491,3,25,"0.5 km","NE",32.6,"TL",270.3],["Slight right at Hauptstraße",721,11,43,"0.7 km","E",98.0,"TSLR",27.5],["Slight left at Runastraße",237,29,57,"0.2 km","N",2.8,"TSLL",315.5],["Turn left at Im Gisinger Feld",53,37,6,"53 m","NW",301.6,"TL",282.3]]} stdClass Object ( [version] => 0.3 [status] => 0 [route_summary] => stdClass Object ( [total_distance] => 1603 [total_time] => 158 [start_point] => Sägerstraße [end_point] => Im Gisinger Feld ) [route_geometry] => Array ( [0] => Array ( [0] => 47.25946 [1] => 9.58395 ) [1] => Array ( [0] => 47.259239 [1] => 9.58449 ) [2] => Array ( [0] => 47.258469 [1] => 9.58625 ) [3] => Array ( [0] => 47.25769 [1] => 9.58806 ) [4] => Array ( [0] => 47.258148 [1] => 9.58849 ) [5] => Array ( [0] => 47.258991 [1] => 9.58929 ) [6] => Array ( [0] => 47.259319 [1] => 9.58957 ) [7] => Array ( [0] => 47.259548 [1] => 9.5898 ) [8] => Array ( [0] => 47.259708 [1] => 9.5901 ) [9] => Array ( [0] => 47.259789 [1] => 9.59034 ) [10] => Array ( [0] => 47.259861 [1] => 9.59071 ) [11] => Array ( [0] => 47.259918 [1] => 9.59088 ) [12] => Array ( [0] => 47.259769 [1] => 9.59246 ) [13] => Array ( [0] => 47.259708 [1] => 9.59299 ) [14] => Array ( [0] => 47.259701 [1] => 9.59367 ) [15] => Array ( [0] => 47.259682 [1] => 9.59403 ) [16] => Array ( [0] => 47.259651 [1] => 9.59418 ) [17] => Array ( [0] => 47.25938 [1] => 9.595 ) [18] => Array ( [0] => 47.259201 [1] => 9.59556 ) [19] => Array ( [0] => 47.259171 [1] => 9.59569 ) [20] => Array ( [0] => 47.25914 [1] => 9.59585 ) [21] => Array ( [0] => 47.259102 [1] => 9.59682 ) [22] => Array ( [0] => 47.259102 [1] => 9.59689 ) [23] => Array ( [0] => 47.258991 [1] => 9.59737 ) [24] => Array ( [0] => 47.25898 [1] => 9.59743 ) [25] => Array ( [0] => 47.258862 [1] => 9.59792 ) [26] => Array ( [0] => 47.258709 [1] => 9.59839 ) [27] => Array ( [0] => 47.25869 [1] => 9.59847 ) [28] => Array ( [0] => 47.258808 [1] => 9.59861 ) [29] => Array ( [0] => 47.258881 [1] => 9.59878 ) [30] => Array ( [0] => 47.25893 [1] => 9.59878 ) [31] => Array ( [0] => 47.25922 [1] => 9.5988 ) [32] => Array ( [0] => 47.259548 [1] => 9.59889 ) [33] => Array ( [0] => 47.25988 [1] => 9.59897 ) [34] => Array ( [0] => 47.26001 [1] => 9.59902 ) [35] => Array ( [0] => 47.260201 [1] => 9.59911 ) [36] => Array ( [0] => 47.260429 [1] => 9.59921 ) [37] => Array ( [0] => 47.260761 [1] => 9.59938 ) [38] => Array ( [0] => 47.261009 [1] => 9.59879 ) ) [route_instructions] => Array ( [0] => Array ( [0] => Head southeast on Sägerstraße [1] => 369 [2] => 0 [3] => 44 [4] => 0.4 km [5] => SE [6] => 122.1 ) [1] => Array ( [0] => Turn left at L60/Nofler Straße [1] => 491 [2] => 3 [3] => 25 [4] => 0.5 km [5] => NE [6] => 32.6 [7] => TL [8] => 270.3 ) [2] => Array ( [0] => Slight right at Hauptstraße [1] => 721 [2] => 11 [3] => 43 [4] => 0.7 km [5] => E [6] => 98 [7] => TSLR [8] => 27.5 ) [3] => Array ( [0] => Slight left at Runastraße [1] => 237 [2] => 29 [3] => 57 [4] => 0.2 km [5] => N [6] => 2.8 [7] => TSLL [8] => 315.5 ) [4] => Array ( [0] => Turn left at Im Gisinger Feld [1] => 53 [2] => 37 [3] => 6 [4] => 53 m [5] => NW [6] => 301.6 [7] => TL [8] => 282.3 ) ) )
Ahora pongo el objeto que envia el servicio web que yo estoy creando: Decoding: {"Status":"todo bien","Features":[{"coordinates":{"Longitud":"-5.64246","Latitud":"43.5348"},"properties":{"Nombr e":"El buen paladar","Direccion":null,"Distancia":4873252,"Des cripcion":"Se trata de un lugar especializado en las chuletas"}},{"coordinates":{"Longitud":"-5.65191","Latitud":"43.5391"},"properties":{"Nombr e":"la sardina saltarina","Direccion":null,"Distancia":4873833,"D escripcion":"establecimiento especializado en los manjares del mar"}},{"coordinates":{"Longitud":"-5.65145","Latitud":"43.5399"},"properties":{"Nombr e":"pizza movil","Direccion":null,"Distancia":4873916,"Descr ipcion":"pizzeria asquerosa pero barata"}},{"coordinates":{"Longitud":"-5.65337","Latitud":"43.5349"},"properties":{"Nombr e":"la tabernona","Direccion":null,"Distancia":4873388,"D escripcion":"especializada en las mejores cervezas"}},{"coordinates":{"Longitud":"-5.66601","Latitud":"43.5221"},"properties":{"Nombr e":"Zapico","Direccion":null,"Distancia":4872124," Descripcion":null}},{"coordinates":{"Longitud":"-5.64869","Latitud":"43.5368"},"properties":{"Nombr e":"Bahia","Direccion":null,"Distancia":4873543,"D escripcion":"hotel con vistas a la playa"}}],"Found":6,"Bounds":{"Limite norte":"43.54000","Limite sur":"43.48677","Limite este":"-5.69771","Limite oeste":"-5.60898"}}
Desgraciadamente no os puedo mostrar el objeto decodificado, porque no sale nada. Lo que me hace pensar que el cliente esta bien. El problema lo estoy teniendo al codificar el objeto en el servicio web.
Estuve mirando informacion por ahi y habia gente que tenia problemas con el tema de los acentos y demas. Pero yo creo k no tengo ningun acento en mi objeto ni caracteres extraños.
¿Se os ocurre que otra cosa puede estar fallando?
Saludos y muchas gracias a todos |