Php 如何解决错误:SOAP-Error:Encoding:object没有';createLead';财产?
我已经编写了一个脚本,它应该连接到一个安全的web服务(ws-security)。但是,在运行脚本时,出现以下错误:Php 如何解决错误:SOAP-Error:Encoding:object没有';createLead';财产?,php,web-services,soap,xsd,wsdl,Php,Web Services,Soap,Xsd,Wsdl,我已经编写了一个脚本,它应该连接到一个安全的web服务(ws-security)。但是,在运行脚本时,出现以下错误: Error: SOAP-ERROR: Encoding: object has no 'createLead' property 我正在使用以下代码: <?php $wsdl = "http://localhost/test/wsdl-src/CRMLeadService.wsdl"; $momurl = "https://integrationdev.momentum.
Error: SOAP-ERROR: Encoding: object has no 'createLead' property
我正在使用以下代码:
<?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' => 'mdrew@gmail.com',
'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";
}
?>
可以在此处下载WSDL和XSD文件:
任何帮助都将不胜感激。谢谢 显示soap
可用函数
运行脚本时,可用函数为:CreateLeadResponse createLead(CreateLeadRequest$parameters)