New users are using the Laravel framework and xampp to build a background management system. The webservice interface function is required to use soap in php. However, the Functiondoesn & #039; texist problem occurs during the development process and has been stuck for a long time. Therefore, I came to ask for help. The details are as follows: Yes...
LaravelFramework and
xamppBuild a background management system. The webservice interface function is required to use soap in php. However
Function doesn't existSo I came to ask for help. The details are as follows:
There are two PHP files:
① Client. php, used as the soap client
Path:C:\xampp\htdocs\my_project\app\Services\client.php
"http://localhost/my_project/app/Services/server.php", 'uri' => "http://localhost/", 'encoding' => 'UTF-8')); echo $client->hello();} catch (SoapFault $fault) { echo "Error: ", $fault->faultcode, ", String: ", $fault->getMessage();}
② Server. php, used as the soap server
Path:C:\xampp\htdocs\my_project\app\Services\server.php
"Localhost"); $ soap-> addFunction ('hello'); $ soap-> handle ();} catch (\ SoapFault $ fault) {echo "Error :", $ fault-> faultcode, ", String:", $ fault-> faultstring;} function hello () {$ model = new User; return "hello ";}
Because templates are requiredserver.phpUsednamespace, AndUserClassuse. Howeverserver.phpInSoapServerAndSoapFaultAdd a forward slash\SoapServerAnd\SoapFault
Finally, runC:\xampp\htdocs\my_project\app\Services\client.phpBut it appearsError: SOAP-ENV:Server, String: Function 'hello' doesn't existError message: Baidu Google has never been unsuccessful. I hope experienced predecessors can give me some advice. Thank you very much!
Reply content:
New user, in useLaravelFramework andxamppBuild a background management system. The webservice interface function is required to use soap in php. HoweverFunction doesn't existSo I came to ask for help. The details are as follows:
There are two PHP files:
① Client. php, used as the soap client
Path:C:\xampp\htdocs\my_project\app\Services\client.php
"http://localhost/my_project/app/Services/server.php", 'uri' => "http://localhost/", 'encoding' => 'UTF-8')); echo $client->hello();} catch (SoapFault $fault) { echo "Error: ", $fault->faultcode, ", String: ", $fault->getMessage();}
② Server. php, used as the soap server
Path:C:\xampp\htdocs\my_project\app\Services\server.php
"Localhost"); $ soap-> addFunction ('hello'); $ soap-> handle ();} catch (\ SoapFault $ fault) {echo "Error :", $ fault-> faultcode, ", String:", $ fault-> faultstring;} function hello () {$ model = new User; return "hello ";}
Because templates are requiredserver.phpUsednamespace, AndUserClassuse. Howeverserver.phpInSoapServerAndSoapFaultAdd a forward slash\SoapServerAnd\SoapFault
Finally, runC:\xampp\htdocs\my_project\app\Services\client.phpBut it appearsError: SOAP-ENV:Server, String: Function 'hello' doesn't existError message: Baidu Google has never been unsuccessful. I hope experienced predecessors can give me some advice. Thank you very much!