Problem with soap trace if error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am using CentOS6.4 with these versions of php:
  php-5.3.3-27.el6_5.x86_64
  php-soap-5.3.3-27.el6_5.x86_64

When I turn on the trace for my soap calls, it only returns data if the call succeeds, but the output if empty if it gets an error/exception.
Here is what I'm doing below, perhaps there is something I am missing?

     $client = getSoapClient ($wsdl);
    try {
            $response = $client->__soapCall('AddServiceTicketViaCompanyId', array($serviceTicketViaCompanyId),
                                          array('uri' => 'http://connectwise.com', 'soapaction' => ''));
            if ( $debugxml ) {   // works fine here
               fwrite($logHandle, "AddServiceTicket Headers:\n".
                        $client->__getLastRequestHeaders()."\n");
               fwrite($logHandle, "AddServiceTicket Request:\n".
                        $client->__getLastRequest()."\n");
            }
    }catch (SoapFault $fault){
            if ( $debugxml ) {   // both headers and request return empty here
               fwrite($logHandle, "AddServiceTicket Error Headers:\n".
                        $client->__getLastRequestHeaders()."\n");
               fwrite($logHandle, "AddServiceTicket Error Request:\n".
                        $client->__getLastRequest()."\n");
            }
            throw new Exception($fault->getMessage());
    }

where
    function getSoapClient ( $wsdl ){
[...]
                if ($trace == 0) {
                   $newclient = @new SoapClient($wsdl);
                } else {
                   $newclient = @new SoapClient($wsdl, array('trace' => 1));
                }
                return $newclient;
[...]
}


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux