Bonjour à tous,
Je réalise une boutique en ligne pour un client, et j'utilise un service (https://taxdataservice.com/Product/U...sTaxWebService) qui me permet de récupérer des taxes pour les Etats-Unis.
J'utilise donc le code fourni par le site tout en l'adaptant à mes besoins.
Voici donc mon code php :
J'obtiens 2 résultats différents :
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 function output_Result( $svcResult ) { echo '<table border="1">'; echo '<tr><td>State:</td><td>' . $svcResult->State. '</td></tr>'; echo '<tr><td>County:</td><td>' . $svcResult->County. '</td></tr>'; /*echo '<tr><td>StateSalesTax:</td><td>' . $svcResult->StateSalesTax. '</td></tr>'; echo '<tr><td>CountySalesTax:</td><td>' . $svcResult->CountySalesTax. '</td></tr>'; echo '<tr><td>CitySalesTax:</td><td>' . $svcResult->CitySalesTax. '</td></tr>';*/ echo '<tr><td>TotalSalesTax:</td><td>' . $svcResult->TotalSalesTax. '</td></tr>'; echo '</table>'; } $USER_ID = 'Mon identifiant'; $PASSWORD = 'Mon Mdp'; $WSDL = 'http://services.taxdataservice.com/TaxSimpleService.svc?WSDL'; $LOCATION = 'http://services.taxdataservice.com/TaxSimpleService.svc/basic'; // create client $client = new SoapClient($WSDL, array('trace' => 1, 'exceptions' => 1, 'location'=>$LOCATION)); global $client; require("./scripts/get_client.php"); $ZIP= $array_client[0]['cp_liv_client']; echo 'CODE ZIP:'.$ZIP.'<br />'; //set up parameter array $params = array("zipcode" => $ZIP, "username" => $USER_ID, "password" => $PASSWORD ); //call the web service operation $result = $client->__soapCall("GetTaxSimpleServiceUS", array($params), null, null, $output_header); //show service results //Note that these are not all the fields contained in the service echo "GetTaxSimpleServiceUS Output:<br />"; output_Result($result->GetTaxSimpleServiceUSResult->ServiceResult);
-soit mon affichage se fait correctement, mais je n'ai récupéré aucune données.
-soit j'ai un message d'erreur immense du genre : Fatal error: Uncaught SoapFault exception: [a:InternalServiceFault] The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.
Précisions : Je suis chez OVH en hébergement mutualisé, j'ai donc du passer mon serveur en php5 via un .htaccess dans le repertoire de mon site. J'ai fait un get_loaded_extensions() pour vérifier que SOAP était bien enabled, et c'est le cas : Soap Client enabled -- Soap Server enabled.
Quelqu'un a-t-il déjà rencontré ce problème? Pensez-vous que le service que j'utilise (étant donné qu'il est basé aux USA me refuse l'accès du fait de mon adresse ip française? Le service client ne me répond pas )
Merci à l'avance de votre aide.
Partager