首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >致命错误:未命名的SoapFault异常:[客户端]SoapFault:编码:对象在

致命错误:未命名的SoapFault异常:[客户端]SoapFault:编码:对象在
EN

Stack Overflow用户
提问于 2013-05-13 07:47:54
回答 1查看 8K关注 0票数 4

我正在尝试将os票证支持系统与opencart连接起来。我试图与这个肥皂集成

代码语言:javascript
复制
<?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;
}
?>

我得到的错误是

代码语言:javascript
复制
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):

代码语言:javascript
复制
$result = $osticket->__call('ostTicket.open',$args);

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

SOAP信息

这是来自phpinfo的

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

发布于 2013-08-27 09:38:25

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

如您在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数组中缺少的内容。只要添加到ticketData数组中,就可以分配w/ null。

例如。'source‘=> null,

这解决了我的问题。希望能帮上忙。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16517114

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档