php - Fatal error: Uncaught SoapFault exception: [Client] SOAP-ERROR: Encoding: object hasn't 'source' property in -


i trying connect osticket support system opencart. tried integrate 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 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 message'),         'topicid'   => 3, //topic website support         'deptid'    => 2, //department sales         'staffid'   => null,         'duedate'   => null,         'time'      => null,         'pri'       => 2, // default priority         'phone'     => null,     ) );  try {     // send request , receive ticketid     $result = $osticket->__call('ostticket.open',$args); } catch (soapfault $e) {     throw $e; } ?> 

the error

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  

here line 60 (/template/information/contact.tpl):

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

i'd grateful if kindly me in issue.

soap info

this 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 

i'm having same problem, , i've been searching web , found no answer. so, traced myself. , loved share how fixed it.

as can see on http://www.website.com/osticket/api/soap/index.php?wsdl (change url)

under ( xsd:complextype name="ticketdata" ),which parameters needed ostticket.open

you can see there's element (xsd:element name="source" type="xsd:string") named source, that's missing on ticketdata array. add inside ticketdata array, can assigned w/ null.

ex. 'source' => null,

this solved problem. hope helps.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -