2014-04-29 189 views
0

訪問我的應用程序時出現錯誤,如下所示dururuy一切都非常複雜。你能否在我需要時通知我?先謝謝你。PHP SOAP錯誤警告

Fatal error: Uncaught SoapFault exception: [HTTP] Unauthorized in C:\wamp\www\gittigidiyor\class\client.php:1284 Stack trace: #0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'https://dev.git...', '', 1, 0) #1 C:\wamp\www\gittigidiyor\class\client.php(1284): SoapClient->__soapCall('isDeveloper', Array) #2 C:\wamp\www\gittigidiyor\class\client.php(97): ggClient->clientConnect('anonymous', 'Developer', 'isDeveloper', Array) #3 C:\wamp\www\gittigidiyor\test.php(8): ggClient->isDeveloper('tolgatasci', 'pass') #4 {main} thrown in C:\wamp\www\gittigidiyor\class\client.php on line 1284 

親愛的朋友們,我 本地主機SOAP客戶端API 土耳其Gitti酒店GİDİYOR.comAPI請求示例。

SOAP CLİENT 
protected function clientConnect($serviceAccessType,$serviceType,$method,$parameters,$xml = array()){ 
    ini_set('soap.wsdl_cache_enabled',0); 
    ini_set('soap.wsdl_cache_ttl',0); 
    $soapParams = array(); 
    if ($serviceType =='Product' || $serviceType =='Developer'){ 
     $url = 'https://dev.gittigidiyor.com:8443/'; 
    }else{ 
     $url = 'http://dev.gittigidiyor.com:8080/'; 
    } 
    $url .= 'listingapi/ws/'; 
    switch ($serviceAccessType) { 
     case 'anonymous': 
      $url .= $serviceType.'Service'; 
      break; 
     case 'individual': 
      $url .= 'Individual'.$serviceType.'Service'; 
      $soapParams = array('apiKey' => $this->apiKey, 
           'sign' => $this->sign, 
           'time' => (float)$this->time); 
      break;  
     case 'internal': 
      $url .= 'Internal'.$serviceType.'Service';break; 

     case 'community': 
      $url .= 'Community'.$serviceType.'Service';break; 
    } 
    $url .= '?wsdl'; 

    foreach ($parameters as $key => $param){ 
     $soapParams[$key]=$param; 
    } 
    if (count($xml) > 0){ 
     foreach ($xml as $xmlRow){ 
      $value = $parameters[$xmlRow]; 
      $soapParams[$xmlRow] = new SoapVar($value,XSD_ANYXML);  
     } 
    } 
    $soapParams['lang'] = $this->lang; 
    var_dump($url); 
    $soapClient = new SoapClient($url, array('login' => $this->auth_user, 'password' => $this->auth_pass, 'authentication' => SOAP_AUTHENTICATION_BASIC)); 
    $result = $soapClient->__soapCall($method,$soapParams); 

    return $result; 
} 

SOAP URL https://dev.gittigidiyor.com:8443/listingapi/ws/DeveloperService?wsdl THANK YOU

回答

0

基本上,你是不是提供所需的登錄憑據。 我猜這是gittigidiyor提供的php庫。它有一個config.ini文件。您應該將值分配給該config.ini文件中的參數。在這條線上創建SoapClient時將使用哪個:

$soapClient = new SoapClient($url, array('login' => $this->auth_user, 'password' => $this->auth_pass, 'authentication' => SOAP_AUTHENTICATION_BASIC)); 
+0

您可以訪問getSales方法嗎?我試圖在休息api上使用它,但得到一個錯誤。 [GG-API-ERROR_511]。你能用它嗎? – Skeletor