I get this SoapFault I dont understand. Calling the function below, codewordStemExists(), should create a SoapClient which connects to a SoapServer that is up and running (no errors that I can found has been reported from the server side).
private static function initClient() {
ini_set("soap.wsdl_cache_enabled", "0");
$classmap = array(
'CodewordStemExists' => 'CodewordStemExists',
'CodewordStemExistsResponse' => 'CodewordStemExistsResponse',
);
$client = new \SoapClient("http://..../service.wsdl", array(
"trace" => true,
"exceptions" => true,
"classmap" => $classmap
));
return $client;
}
public static function codewordStemExists($stem) {
$client = self::initClient();
try {
$req = new CodewordStemExists();
$req->username = "....";
$req->password = "....";
$req->codewordStem = $stem;
$res = $client->codewordStemExists($req);
return (bool)$res->result;
}
catch (\SoapFault $e) {
var_dump($client->__getLastResponse());
}
/** The result from var_dump: */
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://....">
<SOAP-ENV:Body>
<ns1:CodewordStemExistsResponse><ns1:result>false</ns1:result>
</ns1:CodewordStemExistsResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
The SoapFault:
Class 'CodewordStemExistsResponse' not found
CodewordStemExistsResponse is required at bootstrapping, it is possible to instantiate it at any time.
Anyone seen this before? Thanks.
Check if this needs proper namespacing, e.g.
\vendor\CodewordStemExistsResponse.