2011-12-01 4 views
0

WSDL에서 원하는 결과를 얻는 데 문제가 있습니다.Nusoap WSDL 요청이 제대로 작동하지 않습니다.

내 스크립트를

<?php 
require_once($_SERVER['DOCUMENT_ROOT'].'/lib/classes/class.glssoap.php'); 

$glssoap = new GLSSoap; 

echo "<pre>"; 
//print_r($glssoap->GetOneParcelShop(96101)); // SUCCESS 
//print_r($glssoap->GetAllParcelShops()); // SUCCESS 
print_r($glssoap->GetAllParcelShopsInZipcode(8000)); // FAILS : RETURNS operation GetAllParcelShopsInZipcode not present. 
print_r($glssoap->GetNearestParcelShops('Kriegersvej 8', '8000')); // FAILS : RETURNS operation GetNearestParcelShops not present. 
print_r($glssoap->SearchNearstParcelShops('Kriegersvej 8', '8000')); // FAILS : RETURNS operation SearchNearstParcelShops not present. 
echo "</pre>"; 
?> 

클래스 :

<?php 
class GLSSoap { 

    //Get one ParcelShop 
    public function GetOneParcelShop($parcelShopNumber) 
    { 
     $gls_params = array(); 
     $gls_params['ParcelShopNumber'] = $parcelShopNumber; 

     $result = $this->_soapcall('GetOneParcelShop', $gls_params); 

     return $result; 
    } 

    //Returns all ParcelShops in Denmark 
    public function GetAllParcelShops() 
    { 
     $gls_params = array(); 
     $result = $this->_soapcall('GetAllParcelShops', $gls_params); 

     return $result; 
    } 

    //Returns all ParcelShops in a zipcode 
    public function GetAllParcelShopsInZipcode($zipCode) 
    { 
     $gls_params = array(); 
     $gls_params['Zipcode'] = $zipCode; 

     $result = $this->_soapcall('GetAllParcelShopsInZipcode', $gls_params); 

     return $result; 
    } 

    //Search for the nearest ParcelShops to an address - Strict version - used for automated processing 
    public function GetNearestParcelShops($street, $zipCode, $amount = 4) 
    { 
     $gls_params = array(); 
     $gls_params['Street'] = $street; 
     $gls_params['zipcode'] = $zipCode; 
     $gls_params['amount'] = $amount; 

     $result = $this->_soapcall('GetNearestParcelShops', $gls_params); 

     return $result; 
    } 

    //Search for the nearest ParcelShops to an address - Loose version - user should veryfi data 
    public function SearchNearstParcelShops($street, $zipCode, $amount = 4) 
    { 
     $gls_params = array(); 
     $gls_params['Street'] = $street; 
     $gls_params['zipcode'] = $zipCode; 
     $gls_params['amount'] = $amount; 

     $result = $this->_soapcall('SearchNearstParcelShops', $gls_params); 

     return $result; 
    } 

    private function _soapcall($call, $params) 
    { 
     require_once(dirname(__FILE__).'/class.nusoap.php'); 

     $soapclient = new nusoap_client('http://www.gls.dk/webservices_v2/wsPakkeshop.asmx?WSDL','wsdl'); 

     $result = $soapclient->call($call, array('parameters' => $params)); 

     /* Debug */ 
     echo '<h2>Request</h2><pre>' . htmlspecialchars($soapclient->request, ENT_QUOTES) . '</pre>'; 
     echo '<h2>Response</h2><pre>' . htmlspecialchars($soapclient->response, ENT_QUOTES) . '</pre>'; 
     //echo '<h2>Debug</h2><pre>' . htmlspecialchars($soapclient->debug_str, ENT_QUOTES) . '</pre>'; 
     echo '<pre>'; print_r($result); echo '</pre>'; 

     // Check for a fault 
     if ($soapclient->fault) { 
      echo '<div class="alert error"><h2>Fault</h2><pre>'; 
      print_r($result); 
      echo '</pre></div>'; 
     } else { 
      // Check for errors 
      $err = $soapclient->getError(); 
      if ($err) { 
       // Display the error 
       echo '<div class="alert error"><h2>Error</h2><pre>' . $err . '</pre></div>'; 
      } else { 
       return $result; 
      } 
     } 

     return false; 
    } 
}; 
?> 
또한

여기 표현으로 나는 NUSOAP 클래스를 사용하여 더 : http://sourceforge.net/projects/nusoap/


내 문제가 GetAllParcelShopsInZipcode, GetNearestParcelShops입니다 & SearchNearestParcelShops 모두 검색 "작업 X가 없습니다"를 반환합니다.

내가 사용이 서비스는 여기에 있습니다 : http://www.gls.dk/webservices_v2/wsPakkeshop.asmx

사람은 나에게 내가 잘못 뭘하는지 힌트를주지하시기 바랍니다 수 있습니까? 사람이 나중에이 질문에 걸쳐 걸림돌 미리

답변

1

에서

덕분에, 문제는 GLS 문서가 제대로 업데이트되지에게 있습니다. 온라인 웹 서비스에서 여러 메서드의 이름을 확인하십시오.

관련 문제