そのプラグインのチュートリアルに従って動作しましたが、乗算操作の結果ではなく、文字列(foobar)を返そうとしました。
/**
* An action multiplying two numbers.
*
* @WSMethod(webservice='MathApi')
*
* @param double $a Factor A
* @param double $b Factor B
*
* @return string The result //this is the first change
*/
public function executeMultiply($request)
{
$factorA = $request->getParameter('a');
$factorB = $request->getParameter('b');
if(is_numeric($factorA) && is_numeric($factorB))
{
$this->result = 'foobar'; //this is the second and last change
return sfView::SUCCESS;
}
else
{
return sfView::ERROR;
}
}
Webサービスを実行すると、次のようになります。
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://sf1prueba.local/">
<SOAP-ENV:Body>
<ns1:factura_multiplyResponse>
<result>0</result>
</ns1:factura_multiplyResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
ご覧のとおり、結果は「0」として返され、「foobar」を期待していました。