views:

127

answers:

2

How can I call a .Net Web Service from within php. Are there any useful libraries for php 4/5 ?

+4  A: 

If you don't have SoapClient installed then I would recommend nuSoap.

karim79
+4  A: 

I agree with karim79. nuSoap is an excellent, easy to use library.

Once installed, try something like this:

<?php
require_once('libs/nusoap.php'); 
$wsdl="http://www.mydomain.com/mywebservice.wsdl";
$client=new soapclient($wsdl, 'wsdl');
$param=array('myparam1'=>'myval1', 'myparam2'=>'myval2'); 
echo $client->call('mymethodname', $param);
?>

Note that webservices are platform independent by definition, so the fact that the service is written in .NET is not relevant.

JoshJordan