2015-08-07 6 views
0

Я искал этот вопрос Google без успеха .. так что я надеюсь, что вы можете мне помочь ... У меня две системы, и я использую WS для подключения, я использую PHP SOAP-модуль.PHP заголовки удалить cookies

Проблема заключается в том, что мой запрос возвращает ошибку, потому что я отправляю файлы cookie. (Я не устанавливаю файлы cookie в любом месте), но когда я печатаю заголовки, есть файлы cookie ...

Как я могу предотвратить это?

POST /XXXXXXXXXXXXXXX.asmx HTTP/1.1 
Host: example.com 
Connection: Keep-Alive 
User-Agent: PHP-SOAP/5.3.3 
Content-Type: text/xml; charset=utf-8 
SOAPAction: "http://schemas.erp2iecs.com/webservices/IsCompleted" 
Content-Length: 459 
**Cookie: iECSAuth=;iECSAuth1=;** 

Спасибо!

public function connect() 
    { 
     global $db_process, $cfgGeneral; 

     try 
     { 
      $this->client = new SoapClient($this->wsdl,array('trace' => 1)); 

      // Namespace of the webservice 
      $ns = 'http://schemas.erp2iecs.com/webservices'; 
      // Soap header information 
      $headerbody = array('User' => $cfgGeneral['user'],'Password' => $cfgGeneral['pass']); 
      // Creates the header 
      $header = new SOAPHeader($ns, 'Authentication', $headerbody);  
      // Set the Headers of Soap Client. 
      $this->client->__setSoapHeaders($header); 
     } 
     catch(SoapFault $fault) 
     { 
      // Could not connect 
      $this->_error[] = '0003 - Error connecting to SOAP server. Error Message: ' . $fault; 
      $this->report_email("ofiraee_webservice_error", implode(" || ",$this->_error), true); 
      return false; 
     } 
    } 

public function send_request($function, $xml, $parameter_name) 
    { 
     try 
     { 
      // Invokes the method ServerBeginImport and passes the XML above 
      $paramsBody = array(trim($parameter_name)=>trim($xml)); 

      $result = $this->client->$function($paramsBody); 

      $result_function = $function . "Result"; 
      $guid = $result->$result_function; 

      return $guid; 
     } 
     catch(SoapFault $fault) 
     { 
      // Something wrong happened with this! 
      $this->_error[] = '0004 - [ '.$function.'(); ] [ ' . $this->wsdl . ' ] [ SOAP HEADERS ' . $this->client->__getLastRequestHeaders() . ' ] [ SOAP RESPONSE ' . $this->client->__getLastResponse() . ' ] [ SOAP REQUEST ' . $this->client->__getLastRequest() . ' ] Error sending request. Error Message: ' . var_export($paramsBody, true) . $fault; 
      $this->report_email("ofiraee_webservice_error", implode(" || ",$this->_error), true); 
      $this->save_request($guid, $xml); 

      return false;  
     } 
    } 
+0

это помогло бы, если бы мы знали, как вы открывали запрос SOAP ... –

+0

Является resuest заголовков –

+0

@ IAM-декодер жаль, что вы правы, я обновил тему –

ответ

0

Я нашел сольвацию! Чтобы очистить все файлы cookie, присутствующие в объекте клиента мыла, вам просто нужно отключить ($ soapClient -> _ cookies); все файлы cookie удаляются!