PHP SOAP ERROR警告

时间:2014-04-29 13:44:28

标签: php web-services soap wsdl

我在访问我的应用程序时遇到错误,你可以在下面看到dururuy一切都很复杂。你能告诉我我需要的吗?提前谢谢。

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

亲爱的朋友们, 我的本地主机肥皂客户端api 土耳其GİTTİGİDİYOR.comAPİ样品申请。

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 谢谢你

1 个答案:

答案 0 :(得分: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));