Bonjour à tous,

Je suis en train d'essayer de mettre en place un script PHP permettant d'envoyer un fichier vers un serveur en utilisant SOAP. Le fichier est envoyé au serveur et en réponse, le serveur me renvoie un id pour récupérer un nouveau fichier. En gros, je soumets un batch job et le serveur me retourne un fichier retranscrit. Mon problème, c'est que lorsque j'envoie mon fichier, le serveur me prends que la dernière ligne de mon fichier. J'aimerai qu'il me prenne tout le contenu de mon fichier. je sèche un peu sur la solution .
Si quelqu'un peu m'aider ça serait bien .

La description WSDL donnée par le serveur est la suivante:

submitBatchJob type submitBatchJob
data type base64Binary
process - optional, nillable; type string
argument - optional, nillable; type string
email - optional, nillable; type string

SubmitBatchJobResponse type submitBatchJobResponse
submitBatchJobResult - optional, nillable; type string

Voici mon code PHP:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
$URL = 'https://mutalyzer.nl/services/?wsdl';
?><!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Mutalyzer SOAP client</title>
</head>
<body>
<h1>Mutalyzer SOAP client</h1>
<?php
if (isset($_GET['data']) && $_GET['data']) {
 
    $variant = $_GET['data'];
 
 
    $_FILES['data']['name']=$_GET['data'];
    $filename = basename( $_FILES['data']['name']);
    $handle = fopen($filename, "r");
    //$data = fgetcsv($handle, 1000, ",");
 
 
    $NameChecker=$_GET['process'];
    echo '<h2>Result for '.htmlentities($variant).'</h2>';
 
   $options = array('features' => SOAP_SINGLE_ELEMENT_ARRAYS);
 
    $client = new SoapClient($URL, $option);
$data=array();
while(! feof($handle)){
    $data = fgetcsv($handle, 1000);
 
    $result = $client->submitBatchJob(array('data' => $data[0], 'process' =>$NameChecker))
                  ->submitBatchJobResult;
               print_r(array('data' => $data, 'process' =>$NameChecker));
            } 
print_r($result);
}
 
?>
 
<h2>Submit job data file to MUTALYZER</h2>
 
<form action="" method="GET" enctype="multipart/form-data">
<p>
Input file:
</p>
<input name="data" type="file" id="data" />
<br/>
  Process :
<input type="text" size="10" name="process" id="process" value="NameChecker"/>
<br/>
  <input type="submit" name="upload" value="Submit" />
</form>
 
</body>
</html>