2014-04-29 154 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