php – 致命错误:未捕获的SoapFault异常:[客户端] SOAP-ERROR:编码:对象中没有’source’属性

发布时间:2022-04-30 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了php – 致命错误:未捕获的SoapFault异常:[客户端] SOAP-ERROR:编码:对象中没有’source’属性脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试使用OPEncart连接osticket支持系统.
我试图与这个 SOAP集成

<?PHP
error_reporting(E_ALL);
ini_set('display_errors','1');

$osticket = new SOApClient('http://www.websITe.COM/osticket/api/soap/index.PHP?wsdl');

// Set up the parameters
$args = array(
    'username'      => 'WebService','password'      => 'MySecr3tp@ssword','origin'        => 'Web','alertUser'     => true,'alertStaff'    => true,'ticketData'    => array(
        'name'      => utf8_encode('sir test'),'email'     => utf8_encode('some@email.com'),'subject'   => utf8_encode('testing'),'message'   => utf8_encode('this is a message'),'topicId'   => 3,//topic Website Support
        'deptId'    => 2,//department Sales
        'staffId'   => null,'duedate'   => null,'time'      => null,'PRi'       => 2,// default priority
        'phone'     => null,)
);

try {
    // Send the request and receive the ticketID
    $result = $osticket->__call('ostTicket.open',$args);
}
catch (SoapFault $e) {
    throw $e;
}
?>

我得到的错误

Fatal error: Uncaught SoapFault exception: [Client] SOAP-ERROR: Encoding: object hasn't 'source' property in /home/website/website.com/cataLOG/view/theme/testtheme/template/information/contact.tpl:60 
Stack trace: 
#0 /home/website/website.com/catalog/view/theme/testtheme/template/information/contact.tpl(60): SoapClient->__call('ostTicket.open',Array) 
#1 /home/website/website.com/vqmod/vqcache/vq2-system_engine_controller.PHP(67): require('/home/website/tu...') 
#2 /home/website/website.com/catalog/controller/information/contact.PHP(127): Controller->render() 
#3 /home/website/website.com/vqmod/vqcache/vq2-system_engine_front.PHP(43): ControllerInformationContact->index() 
#4 /home/website/website.com/vqmod/vqcache/vq2-system_engine_front.PHP(29): Front->execute(Array,Array) 
#5 /home/website/website.com/index.PHP(238): Front->dispatch(Object(Action)) 
#6 {main} thrown in/home/website/website.com/catalog/view/theme/testtheme/template/information/contact.tpl on line 60

这是第60行(/template/information/contact.tpl):

$result = $osticket->__call('ostTicket.open',$args);

如果有人在这个问题上帮助我,我将不胜感激.

SOAP信息

这是来自PHPinfo

Soap Client enabled
Soap Server enabled

Directive   Local Value Master Value
soap.wsdl_cache 1   1
soap.wsdl_cache_dir /tmp    /tmp
soap.wsdl_cache_enabled 1   1
soap.wsdl_cache_limit   5   5
soap.wsdl_cache_TTL 86400   86400

解决方法

我也有同样的问题,我一直在网上搜索,没有找到答案.所以,我自己追踪它.我喜欢分享我如何解决它.

正如您在http://www.website.com/osticket/api/soap/index.php?wsdl上看到的(将其更改为您的URL)

在(xsd:complexType name =“TicketData”)下,ostTicket.open需要哪些参数

你可以看到有一个名为source的元素(xsd:element name =“source”type =“xsd:string”),这就是ticketData数组中缺少的@L_777_22@.只需在ticketData数组中添加,就可以指定w / null.

恩. ‘source’=>空值,

解决了我的问题.希望能帮助到你.

脚本宝典总结

以上是脚本宝典为你收集整理的php – 致命错误:未捕获的SoapFault异常:[客户端] SOAP-ERROR:编码:对象中没有’source’属性全部内容,希望文章能够帮你解决php – 致命错误:未捕获的SoapFault异常:[客户端] SOAP-ERROR:编码:对象中没有’source’属性所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。