Visualizzazione dei risultati da 1 a 4 su 4

Discussione: client soap

  1. #1

    client soap

    Salve ragazzi, ho uno script soap per collegarmi ad una banca dati

    Codice PHP:
    <?php
    ini_set
    ('memory_limit','512M');
    ini_set('display_errors',true);
    error_reporting(-1);
    require_once 
    dirname(__FILE__) . '/FarmadatiAutoload.php';
    // OGGETTO DELLA CONNESSIONE
    $farmadatiServiceGet = new FarmadatiServiceGet();
    if(
    $farmadatiServiceGet->GetSchemaDataSet(new FarmadatiStructGetSchemaDataSet('XXXXXXX','XCCCCCC','TDZ'FALSE))){
            echo 
    "<h1>STRUTTURA DELLA TABELLA IMMAGINI PARAFARMACI OMEOPATICI DISPOSITIVI MEDICI</H1>";
        
    print_r($farmadatiServiceGet->getResult());
    }else
        
    print_r($farmadatiServiceGet->getLastError());
    ?>
    sI connette perfettamente , output è quello sotto

    Codice PHP:
    FarmadatiStructGetSchemaDataSetResponse Object (     [GetSchemaDataSetResult] => FarmadatiStructGetSchemaDataSet_Output Object         (             [CodEsito] => OK             [DescEsito] => OK             [Fields] => FarmadatiStructArrayOfField Object                 (                     [Field] => Array                         (                             [0] => FarmadatiStructField Object                                 (                                     [Description] => IDKEY TD                                     [IdNum] => 1                                     [Key] => FDI_T431                                     [Length] => 13                                     [Type] => VARCHAR                                     [result:FarmadatiWsdlClass:private] =>                                      [lastError:FarmadatiWsdlClass:private] =>                                      [internArrayToIterate:FarmadatiWsdlClass:private] =>                                      [internArrayToIterateIsArray:FarmadatiWsdlClass:private] =>                                      [internArrayToIterateOffset:FarmadatiWsdlClass:private] =>                                  )                              [1] => FarmadatiStructField Object                                 (                                     [Description] => Codice prodotto TD                                     [IdNum] => 2                                     [Key] => FDI_T218                                     [Length] => 9                                     [Type] => VARCHAR                                     [result:FarmadatiWsdlClass:private] =>                                      [lastError:FarmadatiWsdlClass:private] =>                                      [internArrayToIterate:FarmadatiWsdlClass:private] =>                                      [internArrayToIterateIsArray:FarmadatiWsdlClass:private] =>                                      [internArrayToIterateOffset:FarmadatiWsdlClass:private] =>                                  )                              [2] => FarmadatiStructField Object                                 (                                     [Description] => Progressivo TD                                     [IdNum] => 3                                     [Key] => FDI_T219                                     [Length] => 4,0                                     [Type] => NUMERIC                                     [result:FarmadatiWsdlClass:private] =>                                      [lastError:FarmadatiWsdlClass:private] =>                                      [internArrayToIterate:FarmadatiWsdlClass:private] =>                                      [internArrayToIterateIsArray:FarmadatiWsdlClass:private] =>                                      [internArrayToIterateOffset:FarmadatiWsdlClass:private] =>                                  )                              [3] => FarmadatiStructField Object                                 (                                     [Description] => Codice TD                                     [IdNum] => 4                                     [Key] => FDI_T220                                     [Length] => 1                                     [Type] => VARCHAR                                     [result:FarmadatiWsdlClass:private] =>                                      [lastError:FarmadatiWsdlClass:private] =>                                      [internArrayToIterate:FarmadatiWsdlClass:private] =>                                      [internArrayToIterateIsArray:FarmadatiWsdlClass:private] =>                                      [internArrayToIterateOffset:FarmadatiWsdlClass:private] =>                                  )                              [4] => FarmadatiStructField Object                                 (                                     [Description] => NomeFile Immagine                                     [IdNum] => 5                                     [Key] => FDI_T438                                     [Length] => 256                                     [Type] => VARCHAR                                     [result:FarmadatiWsdlClass:private] =>                                      [lastError:FarmadatiWsdlClass:private] =>                                      [internArrayToIterate:FarmadatiWsdlClass:private] =>                                      [internArrayToIterateIsArray:FarmadatiWsdlClass:private] =>                                      [internArrayToIterateOffset:FarmadatiWsdlClass:private] =>                                  )                          )                      [result:FarmadatiWsdlClass:private] =>                      [lastError:FarmadatiWsdlClass:private] =>                      [internArrayToIterate:FarmadatiWsdlClass:private] =>                      [internArrayToIterateIsArray:FarmadatiWsdlClass:private] =>                      [internArrayToIterateOffset:FarmadatiWsdlClass:private] =>                  )              [SchemaCode] => 1723157922             [result:FarmadatiWsdlClass:private] =>              [lastError:FarmadatiWsdlClass:private] =>              [internArrayToIterate:FarmadatiWsdlClass:private] =>              [internArrayToIterateIsArray:FarmadatiWsdlClass:private] =>              [internArrayToIterateOffset:FarmadatiWsdlClass:private] =>          )      [result:FarmadatiWsdlClass:private] =>      [lastError:FarmadatiWsdlClass:private] =>      [internArrayToIterate:FarmadatiWsdlClass:private] =>      [internArrayToIterateIsArray:FarmadatiWsdlClass:private] =>      [internArrayToIterateOffset:FarmadatiWsdlClass:private] =>  ) 
    Come faccio ad avere il singolo dato, tipo key o id, da poter usare ?sto impazzendo grazie per l'aiuto, vorrei i singoli dati da poter usare
    Ultima modifica di Werwolfe; 08-08-2020 a 19:45

  2. #2
    Nessuno sa darmi una mano, su come estrarre i dati che mi servono? codice, descrizione etc..?

  3. #3
    Ho semplificato molto lo script soap:
    Codice PHP:
    $client = new SoapClient($url);var_dump($client->__getFunctions());
    $parameters = array(    'Username' => 'xxxxx',    'Password' => 'xxxxxx',    'CodiceSetDati' => 'TDZ',    'TracciatoVar' => false);
    $out=$client->GetSchemaDataSet($parameters);
    print_r($out);
    foreach (
    stdClass::Field as $value) {   echo $value->Key;    } 
    Risultato è questo :

    Codice PHP:
     stdClass Object ( [GetSchemaDataSetResult] => stdClass Object ( [CodEsito] => OK [DescEsito] => OK [Fields] => stdClass Object ( [Field] => Array ( [0] => stdClass Object ( [Description] => IDKEY TD [IdNum] => [Key] => FDI_T431 [Length] => 13 [Type] => VARCHAR ) [1] => stdClass Object ( [Description] => Codice prodotto TD [IdNum] => [Key] => FDI_T218 [Length] => [Type] => VARCHAR ) [2] => stdClass Object ( [Description] => Progressivo TD [IdNum] => [Key] => FDI_T219 [Length] => 4,[Type] => NUMERIC ) [3] => stdClass Object ( [Description] => Codice TD [IdNum] => [Key] => FDI_T220 [Length] => [Type] => VARCHAR ) [4] => stdClass Object ( [Description] => NomeFile Immagine [IdNum] => [Key] => FDI_T438 [Length] => 256 [Type] => VARCHAR ) ) ) [SchemaCode] => 1723157922 ) ) 

    Non riesco a capire come estrarre con il forEach i singoli valori, idNum, Key etc, nessuno mi può dare una mano?

    grazie

  4. #4
    Ragazzi come faccio ad estrarre da questo array si singoli elementi?
    Codice PHP:
    array(
        [
    GetSchemaDataSetResult] => Array
            (
                [
    CodEsito] => OK
                
    [DescEsito] => OK
                
    [Fields] => Array
                    (
                        [
    Field] => Array
                            (
                                [
    0] => Array
                                    (
                                        [
    Description] => IDKEY TD
                                        
    [IdNum] => 1
                                        
    [Key] => FDI_T431
                                        
    [Length] => 13
                                        
    [Type] => VARCHAR
                                    
    )

                                [
    1] => Array
                                    (
                                        [
    Description] => Codice prodotto TD
                                        
    [IdNum] => 2
                                        
    [Key] => FDI_T218
                                        
    [Length] => 9
                                        
    [Type] => VARCHAR
                                    
    )

                                [
    2] => Array
                                    (
                                        [
    Description] => Progressivo TD
                                        
    [IdNum] => 3
                                        
    [Key] => FDI_T219
                                        
    [Length] => 4,0
                                        
    [Type] => NUMERIC
                                    
    )

                                [
    3] => Array
                                    (
                                        [
    Description] => Codice TD
                                        
    [IdNum] => 4
                                        
    [Key] => FDI_T220
                                        
    [Length] => 1
                                        
    [Type] => VARCHAR
                                    
    )

                                [
    4] => Array
                                    (
                                        [
    Description] => NomeFile Immagine
                                        
    [IdNum] => 5
                                        
    [Key] => FDI_T438
                                        
    [Length] => 256
                                        
    [Type] => VARCHAR
                                    
    )

                            )

                    )

                [
    SchemaCode] => 1723157922
            
    )
     ) 

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.