PHP SOAP client WSDL Example: In this post i will how to make an Soap Client Call in php. Using soap client call we can interpretate WSDL file very easily and extract the data from file in PHP.
First make sure that SOAP enabled on your server. You can check soap status using phpinfo(); function php.
echo phpinfo();
After that all server configuration shows and find out Soap Client Enabled or not.
Soap Client WSDL Call in PHP:
We get the WSDL file information using $client object. Use provided method with parameter in below soap example.
1 2 3 4 5 6 |
$param = array('iTopN'=>5); $client = new SoapClient("http://www.example.com/info.wso?wsdl"); $result = $client->MethodName($param); echo "<pre>"; print_r($result); |
Login using Soap Client Method:
Using soap client with HTTP authentication over a proxy server. Pass your access and proxy server detail as array parameter to authorize your call.
1 2 3 4 5 6 7 8 9 10 11 |
<?php $client1 = new SoapClient('http://portaone.com/soap/Session',array('proxy_host' => "portabox.local.com", 'proxy_port' => 443, 'proxy_login' => "Username", 'proxy_password' => "Password")); $result=$client1->__soapCall("login",array()); echo "<pre>"; print_r($result); ?> |
Above mentioned soap method explain How to use for make an call in PHP. I hope this example makes easy for you to access and authorize using soap client wsdl call. If need any assistance feel free to contact me.