Home >Backend Development >PHP Tutorial >webservice video tutorial Code for calling ASPNET's WebService in PHP
There is a web method like this:
Copy code The code is as follows:
[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
Copy the code The code is as follows:
//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();
if(! is_soap_fault($result))
{
echo "return:n", $result->GetLocalizationResourceResult;
}
else
{
echo "soap call fault";
}
?>
The above has introduced the webservice video tutorial code for calling ASPNET's WebService in PHP, including the content of the webservice video tutorial. I hope it will be helpful to friends who are interested in PHP tutorials.