Como resolver o erro: SOAP-ERROR: Codificação: o objeto não possui uma propriedade 'createLead'?

Eu escrevi um script que deve se conectar a um serviço da Web seguro (ws-security). No entanto, ao executar o script, estou recebendo este erro:

Error: SOAP-ERROR: Encoding: object has no 'createLead' property

Eu estou usando este código:

<?php
$wsdl = "http://localhost/test/wsdl-src/CRMLeadService.wsdl";
$momurl = "https://integrationdev.momentum.co.za/sales/CRMService/CRMLeadService_v1_0/";

echo "Post to URL: {$momurl}\n";

$username = '817221';
$password = '1234';

//Perform Request
$client = new SoapClient ($wsdl, array('loacation' => $momurl));

$security = array('UsernameToken' => array(
    'Username'=>"$username",
    'Password'=>"$password"
));

$header = new SoapHeader('wsse','Security',$security, false);
$client->__setSoapHeaders($header);

print_r($client);
echo "<br />";

print_r( $client->__getFunctions() ); //Available Function

$params = array(
    'LeadSourceId' => '23627e70-a29e-e211-b8a8-005056b81ebe',
    'AffiliateLeadReference' => '5465546hdfh5sggd52',
    'Title' => '852800018',
    'Initials' => 'MD',
    'PreferredName' => 'Marius',
    'FirstName' => 'Marius',
    'LastName' => 'Drew',
    'PreferredCorrespondenceLanguage' => '852800001',
    'PreferredCommunicationMethod' => '852800000',
    'Campaign' => '',
    'HomePhoneNumber' => '0723621762',
    'BusinessPhoneNumber' => '0723621762',
    'MobilePhoneNumber' => '0723621762',
    'EmailAddress' => '[email protected]',
    'Notes' => 'IMU',
    'ProductCategories' => array('Code' => 'd000083d-229c-e211-b8a8-005056b81ebe')
);

print_r($params);

try { 
    echo $result = $client->__soapCall('createLead',array('parameters'=>$params));
} catch (Exception $e) { 
    $msgs = $e->getMessage();
    echo "Error: $msgs"; 
} 
?>

Os arquivos WSDL e XSD podem ser baixados aqui:

http://sdrv.ms/16KC8o4

Qualquer ajuda seria apreciada. Obrigado!

questionAnswers(0)

yourAnswerToTheQuestion