webservice video tutorial Code for calling ASPNET's WebService in PHP

WBOY
Release: 2016-07-29 08:44:55
Original
1283 people have browsed it

There is a web method like this:

Copy code The code is as follows:


[WebMethod]
public string HelloWorld()
{
return "Hello World";
}


ok, everything is ready . The following is written in a php file:
php5 itself supports SOAP to call Web Service:

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";
}
?>


This is OK , will continue to introduce SOAP

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.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!