/** * This call will throw SoapFault and it will return * string as ".. Function ("getUnkownMethod") is not a valid method for this service...." * So it will be easy to debug it. * * @note The call will not be executed when $client->run() */ $requestIds[] = $client->getUnkownMethod(array('wrongParam' => 'Dummy')); /** * This call will throw SoapFault and it will return * string as ".. Function ("getAnotherUnkownMethod") is not a valid method for this service...." * So it will be easy to debug it. * * @note The call will not be executed when $client->run() */ $requestIds[] = $client->getAnotherUnkownMethod(array('dummy' => 'test')); /** * This call is valid method but it has wrong parameters so it will return normal request id but in the execution * it will return result instance of SoapFault contains the exception * So you can handle it */ $requestIds[] = $client->getFullname(array('wrongParams' => 'Xyz')); /** * Adding another 5 SoapCalls to test different method call * in the next for loop i will make 5 soap request */ for ($i = 0; $i < 5; $i++) { /** @var $params , method parameters will be used in the test */ $params = array('session' => $session, 'name' => 'Mohamed ' . $i); $requestIds[] = $client->sayHello($params); }
/** * This call will throw SoapFault and it will return * string as ".. Function ("getUnkownMethod") is not a valid method for this service...." * So it will be easy to debug it. * * @note The call will not be executed when $client->run() */ $requestIds[] = $client->getUnkownMethod(['wrongParam' => 'Dummy']); /** * This call will throw SoapFault and it will return * string as ".. Function ("getAnotherUnkownMethod") is not a valid method for this service...." * So it will be easy to debug it. * * @note The call will not be executed when $client->run() */ $requestIds[] = $client->getAnotherUnkownMethod(['dummy' => 'test']); /** * This call is valid method but it has wrong parameters so it will return normal request id but in the execution * it will return result instance of SoapFault contains the exception * So you can handle it */ $requestIds[] = $client->getFullname(['wrongParams' => 'Xyz']); /** * Adding another 5 SoapCalls to test different method call * in the next for loop i will make 5 soap request */ for ($i = 0; $i < 5; $i++) { /** @var $params , method parameters will be used in the test */ $params = ['session' => $session, 'name' => 'Mohamed ' . $i]; $requestIds[] = $client->sayHello($params); }