How to parse serialized json from php web service in java play framework 1.2.x -


i need use from php web service rendering data serializing json in java play framework 1.2.x. doing using play ws function. , getting data service. when try jsonobject throws excepiton normal, because returned data not json format well. body knows workarounds or solution appreciated.

httpresponse htp = ws.url("http://www.geoplugin.net/php.gp?ip=78.171.90.49").get();             system.out.println(htp.getcontenttype()+"\n"+htp.getstatustext()+"\n"+htp.getstring()); 

the returned data :

a:18:{s:17:"geoplugin_request";s:12:"78.171.90.49";s:16:"geoplugin_status";i:200;s:16:"geoplugin_credit";s:145:"some of returned data includes geolite data created maxmind, available <a href=\'http://www.maxmind.com\'>http://www.maxmind.com</a>.";s:14:"geoplugin_city";s:8:"istanbul";s:16:"geoplugin_region";s:8:"istanbul";s:18:"geoplugin_areacode";s:1:"0";s:17:"geoplugin_dmacode";s:1:"0";s:21:"geoplugin_countrycode";s:2:"tr";s:21:"geoplugin_countryname";s:6:"turkey";s:23:"geoplugin_continentcode";s:2:"eu";s:18:"geoplugin_latitude";s:7:"41.0186";s:19:"geoplugin_longitude";s:9:"28.964701";s:20:"geoplugin_regioncode";s:2:"34";s:20:"geoplugin_regionname";s:8:"istanbul";s:22:"geoplugin_currencycode";s:3:"try";s:24:"geoplugin_currencysymbol";s:15:"&#89;&#84;&#76;";s:29:"geoplugin_currencysymbol_utf8";s:3:"ytl";s:27:"geoplugin_currencyconverter";s:6:"2.2669";} 

you accessing php endpoint. need hit url instead:

http://www.geoplugin.net/json.gp?ip=78.171.90.49


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -