2015-02-23 62 views
0

我想PHP對象傳遞到SOAP服務通行證PHP對象爲SOAP

$client = new phpWebServiceClient('kursevi_servis', true); //service 

$criteria = new stdClass(); 
      $criteria->limit = $limit; 
      $criteria->offset = $offset; 
      $criteria->search_term = $keyword; 
         var_dump($client->__getFunctions()); 

$client->pretraga_jedinica($criteria) 
在wsdl文件

我嘗試

<xsd:complexType name="trazeneJedinice"> 
       <xsd:sequence> 
        <xsd:element name="trazeneJediniceObj" 
         type="tns:trazeneJediniceObjType" maxOccurs="unbounded" 
         minOccurs="0"> 
        </xsd:element> 
        <xsd:element name="count_all" type="xsd:int"></xsd:element> 
       </xsd:sequence> 
      </xsd:complexType> 

      <xsd:complexType name="trazeneJediniceObjType"> 
       <xsd:sequence> 
        <xsd:element name="limit" type="xsd:int"></xsd:element> 
        <xsd:element name="offset" type="xsd:int"></xsd:element> 
        <xsd:element name="keyword" type="xsd:string"></xsd:element> 

       </xsd:sequence> 
      </xsd:complexType> 

,但我得到的錯誤

Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host in C:\wamp\www\link-university\application\modules\lessons\controllers\lessons.php:296 Stack trace: #0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'http://phpweb/l...', 'http://localhos...', 1, 0) #1 C:\wamp\www\link-university\application\modules\lessons\controllers\lessons.php(296): SoapClient->__call('pretraga_jedini...', Array) #2 C:\wamp\www\link-university\application\modules\lessons\controllers\lessons.php(296): phpWebServiceClient->pretraga_jedinica(Object(stdClass)) #3 [internal function]: Lessons->search() #4 C:\wamp\www\link-university\system\codeigniter\CodeIgniter.php(236): call_user_func_array(Array, Array) #5 C:\wamp\www\link-university\index.php(116): require_once('C:\wamp\www\lin...') #6 {main} thrown in C:\wamp\www\link-university\application\modules\lessons\controllers\lessons.php on line 296 

也時我var_dump肥皂我得到了

array (size=13) 
    0 => string 'nizKurseva spisak_kurseva(string $spisak_kursevaRequest)' (length=56) 
    1 => string 'trazeneJedinice pretraga_jedinica(UNKNOWN $pretraga_jedinicaRequest)' (length=68) 
    2 => string 'nizModula moduli_kursa(int $moduli_kursaRequest)' (length=48) 
    3 => string 'nizJedinica jedinice_modula(int $jedinice_modulaRequest)' (length=56) 
    4 => string 'nizElemenata elementi_jedinice(int $elementi_jediniceRequest)' (length=61) 
    5 => string 'JedinicaPodaci jedinica(int $jedinicaRequest)' (length=45) 
    6 => string 'ModulPodaci modul(int $modulRequest)' (length=36) 
    7 => string 'KursPodaci kurs(string $kursRequest)' (length=36) 
    8 => string 'trazeniKursevi pretraga_kurseva(string $pretraga_kursevaRequest)' (length=64) 
    9 => string 'TestPodaci test(int $testRequest)' (length=33) 
    10 => string 'nizKurseva spisak_testova(string $spisak_testovaRequest)' (length=56) 
    11 => string 'nizGrupa getGrupe(int $getGrupeRequest)' (length=39) 
    12 => string 'jediniceByKurs jedinice_by_kurs(int $jedinice_by_kursRequest)' (length=61) 

我有UNKNOW,也許是這裏的錯誤,我不能圖什麼我等在此行

1 => string 'trazeneJedinice pretraga_jedinica(UNKNOWN $pretraga_jedinicaRequest)' (length=68) 

回答

1

胡亂猜測 做錯了,無效/錯誤輸入/丟失的服務器名稱?會解釋你的無法連接錯誤。