creates a C# web service. I won't go into details about this. I used the wizard of vs2008 to create the simplest one. Yes, let it run at: http://localhost/webservice1/service1.asmx
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 certain php file: php5 itself supports SOAP to call Web Service:
<?php //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"; } ?>
That’s OK, I will continue to introduce SOAP
The above is the entire content of this article, I hope you all like it.
Please take a moment to share the article with your friends or leave a comment. We will sincerely thank you for your support!