Last active
June 28, 2019 09:33
-
-
Save kcassam/669479c03dc46b21d1fb3b8a0aacf107 to your computer and use it in GitHub Desktop.
working soap example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Invocation simple à un Service WEB : la classe SoapClient() comporte des paramètres supplémentaires | |
* qui seront intéressants à étudier dans la documentation | |
*/ | |
//On doit passer le fichier WSDL du Service en paramètre de l'objet SoapClient() | |
$wsdl="http://www.dneonline.com/calculator.asmx?wsdl"; | |
$service=new SoapClient($wsdl); | |
//À partir de là, on peut déjà faire appel aux méthodes du service décrites dans le WSDL | |
$result = $service->Add(['intA' => 2, 'intB' => 3]); | |
//On renvoie le résutat de notre méthode, pour voir.... | |
print_r($result); | |
/******************************************************* | |
Output : | |
[email protected] in /shared/httpd $ php soapdemo.php | |
stdClass Object | |
( | |
[AddResult] => 5 | |
) | |
********************************************************/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment