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

我正在尝试使用opencart连接osticket支持系统.

我试图与这个SOAP集成

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

解决方法:

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

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

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

恩. ‘source’=>空值,

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

标签:php,soap,soapfault

来源: https://codeday.me/bug/20190625/1284392.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值