I calling wsdl webservice and get following JSON string
eg :
$result = '
{
"Value":
[
{"Username":"CustomerName1","Password":"123","ResellerID":"888"},{"Username":"CustomerName2","Password":"123orAnyChar","ResellerID":"378"}
],
"Error":{"Check":false,"Msg":"No Error!"}
}
';
How to convert this php code to java code :
Example php code :
$MyArray = json_decode($result, true);
if (array_key_exists("Error", $MyArray)) {
if ($MyArray['Error']['Check'] != true) {
foreach ($MyArray['Value'] as $Key => $Val) {
echo "Username = ".$Val['Username']." , Pass = ".$Val['Password']." , ResID = ".$Val['ResellerID']."\r\n";
}
}
else {
echo "Error Msg";
}
}
Note : just convert this php code block to java, using sample json string
thanks