-
-
Save alexllnk/ef3b055e09e132a9b8f9ff07b31f38eb to your computer and use it in GitHub Desktop.
PHP soap client 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
| ini_set('soap.wsdl_cache_enabled', 0); | |
| ini_set('soap.wsdl_cache_ttl', 900); | |
| ini_set('default_socket_timeout', 15); | |
| $params = array('param1'=>$param1); | |
| $wsdl = 'http://service_url/method?WSDL'; | |
| $options = array( | |
| 'uri'=>'http://schemas.xmlsoap.org/soap/envelope/', | |
| 'style'=>SOAP_RPC, | |
| 'use'=>SOAP_ENCODED, | |
| 'soap_version'=>SOAP_1_1, | |
| 'cache_wsdl'=>WSDL_CACHE_NONE, | |
| 'connection_timeout'=>15, | |
| 'trace'=>true, | |
| 'encoding'=>'UTF-8', | |
| 'exceptions'=>true, | |
| ); | |
| try { | |
| $soap = new SoapClient($wsdl, $options); | |
| $data = $soap->method($params); | |
| } | |
| catch(Exception $e) { | |
| die($e->getMessage()); | |
| } | |
| var_dump($data); | |
| die; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment