Last change
on this file since 68 was
68,
checked in by cbipsl, 14 years ago
|
commit v1 eccad
|
-
Property svn:executable set to
*
|
File size:
1.9 KB
|
Line | |
---|
1 | <?php |
---|
2 | /****************************************************************************** |
---|
3 | This function creates the request to the server for the extraction |
---|
4 | ******************************************************************************/ |
---|
5 | include 'xmlrpc.inc'; |
---|
6 | //include 'xmlrpc_extension_api.inc'; |
---|
7 | $client = new xmlrpc_client('http://zeus/cgi-bin/eccad_extract.cgi'); |
---|
8 | $client->return_type = 'phpvals'; |
---|
9 | |
---|
10 | |
---|
11 | |
---|
12 | |
---|
13 | |
---|
14 | //write the request |
---|
15 | $idParam=split('-',$_GET["Parameter"]); |
---|
16 | $idParam=$idParam[0]; |
---|
17 | $idProd=split('-',$_GET["Product"]); |
---|
18 | $idProd=$idProd[0]; |
---|
19 | $requete = '<?xml version="1.0"?><requete xmlns="http://www.mediasfrance.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="/home/djoumi/ECCAD/eccadTest/shr.xsd"><idproduit>'.$idProd.'</idproduit><idparametre>'.$idParam.'</idparametre><dateDebut>'.$_GET["Year1"].'-'.$_GET["Month1"].'-'.$_GET["Day1"].'</dateDebut>'; |
---|
20 | if($_GET["Year2"]=='') |
---|
21 | { |
---|
22 | $requete.='<dateFin>'.$_GET["Year1"].'-'.$_GET["Month1"].'-'.$_GET["Day1"].'</dateFin>'; |
---|
23 | } |
---|
24 | else |
---|
25 | { |
---|
26 | $requete.='<dateFin>'.$_GET["Year2"].'-'.$_GET["Month2"].'-'.$_GET["Day2"].'</dateFin>'; |
---|
27 | } |
---|
28 | $requete.='<latMin>'.$_GET["LowRightLat"].'</latMin><latMax>'.$_GET["UpLeftLat"].'</latMax><lonMin>'.$_GET["UpLeftLon"].'</lonMin><lonMax>'.$_GET["LowRightLon"].'</lonMax><datafileformat>'.$_GET["DataFileFormat"].'</datafileformat><datafilecompress>'.$_GET["DataFileCompress"].'</datafilecompress><user><nom>mon nom</nom><prenom>mon prenom</prenom><mail>caubet@medias.cnes.fr</mail></user></requete>'; |
---|
29 | |
---|
30 | |
---|
31 | |
---|
32 | |
---|
33 | |
---|
34 | // Send a message to the server. |
---|
35 | $message = new xmlrpcmsg('extract', array(new xmlrpcval($requete, 'string'))); |
---|
36 | $result = $client->send($message); |
---|
37 | // Process the response. |
---|
38 | if (!$result) |
---|
39 | { |
---|
40 | print "<p>Could not connect to HTTP server.</p>"; |
---|
41 | } |
---|
42 | elseif ($result->faultCode()) |
---|
43 | { |
---|
44 | print "<p>XML-RPC Fault #" . $result->faultCode() . ": " . |
---|
45 | $result->faultString(); |
---|
46 | } |
---|
47 | else |
---|
48 | { |
---|
49 | echo $result->value(); |
---|
50 | } |
---|
51 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.