Hi! First start with the SOAP mod is great. But don't understand why I sometimes get Uncaught SoapFault exception errors. Then, I found that the order of the elements in the $args array has an impact. Didn't expect that! See how the following first call works but not the second. Is it the Mod, or my server? Please provide any thoughts and suggestions. Thank you!
<?php
require_once('api/soap/lib/classes/nusoap.class.php');
$osticket = new SoapClient('http://www.xxx.com/osticket/api/soap/index.php?wsdl');
$args = array(
'username' => 'username',
'password' => 'password',
'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
'pri' => 2, // default priority
'phone' => '012-345678'
)
);
try {
// Send the request and receive the ticketID
$result = $osticket->__call('ostTicket.open',$args);
}
catch (SoapFault $e) {
throw $e;
}
echo('first '.$result);
$args = array(
'password' => 'password',
'username' => 'username',
'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
'pri' => 2, // default priority
'phone' => '012-345678'
)
);
try {
// Send the request and receive the ticketID
$result = $osticket->__call('ostTicket.open',$args);
}
catch (SoapFault $e) {
throw $e;
}
echo('second '.$result);
?>