Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.Net Web Service call from php

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

like image 698
crauscher Avatar asked Jan 24 '23 08:01

crauscher


1 Answers

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.

like image 101
JoshJordan Avatar answered Jan 31 '23 23:01

JoshJordan