Index: soapclient.module =================================================================== --- soapclient.module (revision 2334) +++ soapclient.module (working copy) @@ -592,6 +596,11 @@ $result['#error'] = t($e->getMessage()); return $result; } + if ( isset($options['headers']) ) + { + $sv = new SoapVar($options['headers'], XSD_ANYXML); + $client->__setSoapHeaders(array(new SoapHeader('example.com', 'dontcareaboutname', $sv))); + } } else // not supported library { Index: lib/drupal_soap_client.inc =================================================================== --- lib/drupal_soap_client.inc (revision 2334) +++ lib/drupal_soap_client.inc (working copy) @@ -70,6 +70,8 @@ $this->options['style'], $this->options['use']); + $result['#headers'] = $this->client->responseHeader; + if ( $this->client->fault ) { $result['#error'] = t('Fault !code: !msg', array( '!code' => $result['return']['faultcode'], '!msg' => $result['return']['faultstring'] )); @@ -88,7 +90,16 @@ { try { - $result['#return'] = $this->client->__soapCall($function, $params); + $response_headers = array(); + // XXX Why does $params need to be wrapped in an additional array? Bug in PHP? + $result['#return'] = $this->client->__soapCall( + $function, + array($params), + array(), + array(), + $response_headers + ); + $result['#headers'] = soapclient_object_to_array($response_headers['Header']); } catch(Exception $e) {