1

New to SOAP, and I am having a problem passing in a JSON Object.

The webservice is returning an error saying that it contains nothing (Null) My code is below.

$params = json_encode(array(
    'AuthCode'      => $authCode,
    'FirstName'         => $firstname,
    'LastName'      => $lastname,
    'Email'             => $email,
    'Telephone'         => $telephone,
    'Country'       => $country
));

$data = array (
    'jsonObject' => $params
);

$client = new SoapClient($serviceURL, array (
    "trace"         => 1,
    "exceptions"        => 0,
    "encoding"      => 'UTF-8',
    "soap_version"  => SOAP_1_1
));

$res = $client->CreateUser(array('parameters' => $data));

We have set up for the service to check if there is valid data, and it appears there is none, so it returns NULL.

Have I constructed my parameters correctly?

Many thanks in advance

4

0 回答 0