A
A
andrys20072019-02-17 10:28:51
PHP
andrys2007, 2019-02-17 10:28:51

Make a PHP-SOAP-WSDL test service. I call one function, and another is executed?

Greetings. I want to understand how the SOAP service works on PHP (Server-Client) and came across this problem: There is a WSDL description:
<?php
/**
* smsservice.wsdl.php
*/
header("Content-Type: text/xml; charset= utf-8");
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
?>
There is a server function:
<?php
header("Content-Type: text/html; charset=utf-8");
header('Cache-Control: no-store, no-cache');
header('Expires: '.date('r'));
ini_set("soap.wsdl_cache_enabled", "0"); // disable caching of the WSDL file for testing
ini_set('display_errors', 1);
file_put_contents("log.txt","smsservice_1 \r\n",FILE_APPEND);
class TestClass
{
function getUserINFO($ID)
{
file_put_contents("log.txt","call getInfoUser \r\n",FILE_APPEND);
return array("FIO" => "Sidorov Ivan Andreevich","ADRES"=>"Trudovaya 160","STATUS"=>"Open","ID"=>$ID);
}
function getOrganINFO($ID)
{
file_put_contents("log.txt","call getInfoUser \r\n",FILE_APPEND);
return array("FIO" => "HORN AND HOOVES","ADRES"=>"Kazybek bi","STATUS"=>"Curled","ID"=>$ID);
}
}
$server = new SoapServer(" www.sp.com/smsservice.wsdl.
header("Content-Type: text/html; charset=utf-8");
header('Cache-Control: no-store, no-cache');
header('Expires: '.date('r'));
ini_set("soap.wsdl_cache_enabled", "0" );
ini_set('display_errors', 1);
ini_set("soap.wsdl_cache_ttl", "0" );
error_reporting(E_ALL & ~E_NOTICE);
$client = new SoapClient(" www.sp.com/smsservice.wsdl.php ",array( 'soap_version' => SOAP_1_2));
//$rez=$client->getOrganINFO(50000);
echo '
--------------getUserINFO-------------
';
$rez=$client->__soapCall('getUserINFO',array("a",50000));
var_dump($rez);
$rez=$client->__soapCall('getOrganINFO',array("a",10000));
var_dump($rez);
?>
In the WSDL, I described that I have two functions on the server getUserINFO, getOrganINFO
but when I call getOrganINFO from the client, getUserINFO is always called ...
Why is that? Yes, they have the same parameters, but nevertheless these are different functions and there should be different calls.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question