0

I tried a few methods but I could not reach the desired result. I could not parse the data from Json as foreach.

$params();
$client = new SoapClient('http://example.com/services?wsdl');
$return = $client->ServiceResp($params);
foreach($return as $turn){
    print_r($turn->returnValue);
}

Output:

{
    "returnValue": {
        "personelInformation": {
            "kimlikTipi": "x",
            "kimlikNo": "x",
            "adi": "xxxx",
            "soyadi": "xxx",
            "ilKodu": "0",
            "ilceKodu": "0",
            "uyruk": "1",
            "mernisBilgisi": "0",
            "oid": "xxxxx",
            "created": "Kas 21, 2017",
            "createdBy": "admin"
        },
        "adres": [],
        "iletisim": [{
            "kisiOid": "xxxxxx",
            "iletisimTercihi": " ",
            "odaBorsaNo": "xxxx",
            "odaBorsaSubeNo": "xxxx",
            "oid": "xxxxxx",
            "created": "Kas 17, 2017",
            "createdBy": "Admin"
        }],
        "telefon": [],
        "eposta": [],
        "ortaklar": [],
        "temsilciler": [],
        "ilgililer": []
    }
}

The information comes in this way, but for example I can't get the staff information part

0

1 Answer 1

1

You're almost there. Just use json_decode() to convert that into an object that you can access the properties:

$person = json_decode($turn->returnValue);
echo $person->returnValue->personelInformation->created;

Outputs:

Kas 21, 2017

Demo

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.