Zmiany pomiędzy wersją początkową i wersją 1 dla DeployerGuide/Others/eDokumentyApi/SearchProcess

Pokaż
Ignoruj:
Data i czas:
05/21/14 10:02:52 (10 years temu)
Autor:
WN (IP: 213.227.67.33)
Komentarz:

--

Legend:

Bez zmian
Dodane
Usunięte
Zmienione
  • DeployerGuide/Others/eDokumentyApi/SearchProcess

    v1 v1  
     1= [wiki:DeployerGuide Przewodnik wdrożeniowca] > Wyszukaj sprawę = 
     2 
     3 
     4''' Definicja parametrów: ''' 
     5{{{ 
     6#!php 
     7<?php 
     8 
     9/** 
     10 *  Zwraca dane sprawy 
     11 *    
     12 *  @param prc_id Int - Id sprawy (processes:prc_id) 
     13 *    
     14 *  @return Array - tablica danych sprawy jeśli sukces, SoapFault w razie niepowodzenia 
     15 *    
     16 *  @throws Exception - SoapFault 
     17 */ 
     18Array getProcess(Int prc_id) 
     19 
     20?> 
     21}}} 
     22 
     23''' Przykłady wywołań: ''' 
     24{{{ 
     25#!php 
     26 
     27// Plik MyService.php umieszczony w apps/edokumenty. 
     28// MyService.php 
     29<?php 
     30 
     31define('EDOK_API_LOGIN', 'developer'); 
     32define('EDOK_API_PASSWORD', 'developer'); 
     33define('DEFAULT_ENTITY_SYMBOL', 'demo'); 
     34 
     35require_once('./classes/eDokumentyApi/EDokApiClient.inc'); 
     36 
     37$options = array( 
     38    'location' => 'http://{host}:{port}/eDokumentyApi.php', 
     39    "uri" => "eDokumentyAPI", 
     40    'encoding'=>'UTF-8' 
     41); 
     42         
     43$client = new EDokApiClient(NULL, $options); 
     44$client->setUser(EDOK_API_LOGIN); 
     45$client->setPass(md5(EDOK_API_PASSWORD)); 
     46$header = new SoapHeader('eDokumentyAPI', 'entity_symbol', DEFAULT_ENTITY_SYMBOL); 
     47$client->__setSoapHeaders($header); 
     48 
     49$prc_id = 4578; 
     50$process = array(); 
     51 
     52try { 
     53    $process = $client->getProcess($prc_id); 
     54    var_dump($process); 
     55} catch(SoapFault $fault) {    
     56    var_dump($fault); 
     57     
     58    if ($fault->faultcode < 100) { 
     59        trigger_error("SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR); 
     60    } 
     61} 
     62 
     63?> 
     64}}}