Showing results for 
Search instead for 
Did you mean: 

Can't create soap header

Can't create soap header



we're trying to send a soap request to the purolator shipping API. We are stuck at the header portion.


This is what we are sending the shipping API:


   // Probleme ICI

        try {
  //Define the SOAP Envelope Headers
  $headers[] = new SoapHeader ( '',
                                array (
                                        'Version'           =>  '1.4',
                                        'Language'          =>  'en',
                                        'GroupID'           =>  'xxx',
                                        'RequestReference'  =>  'Rating Example'
            ->get('Psr\Log\LoggerInterface')->debug('soapHeader created');

        } catch (\Exception $e) {
                //$debugData['result'] = ['error' => $e->getMessage(), 'code' => $e->getCode()];

  //Apply the SOAP Header to your client


                return $client;


It's simply not catching the error with the trap we made. What are we doing wrong?