PHP calls WebService of ASP.NET

  • 2020-05-05 10:59:07
  • OfStack

There is an web method like this:
public string HelloWorld() 
return "Hello World"; 

ok, all set. In an php file, write as follows:
php5 itself supports SOAP calling Web Service:
//get localization strings from C# webservice 
$client = new SoapClient('http://localhost/webservice1/Localization.asmx?wsdl'); 

echo "Call web service method from C# WebService:\n"; 
$result = $client->GetLocalizationResource(); 

echo "return:\n", $result->GetLocalizationResourceResult; 
echo "soap call fault"; 

So that's OK, and we'll continue with SOAP

Related articles: