christiankerl / ckWebServicePlugin

Build SOAP and WSDL based web services with symfony 1.x.
MIT License
11 stars 5 forks source link

Returning Issue #6

Open ajoudeh opened 12 years ago

ajoudeh commented 12 years ago

Dear ,

i create a soap function & it;s return an Array of String, but when i call it, it return an Object of Class stdClass ???

Server Side: /* * @WSMethod(name='setCountry', webservice='DataApi') * @param integer $id * @param string $en_name * @param string $ar_name * @param string $updated_at * @return string The result / public function executeSetCountry(sfWebRequest $request) { try { $id = $request->getParameter('id'); $ar_name = $request->getParameter('ar_name'); $en_name = $request->getParameter('en_name'); $updated_at = $request->getParameter('updated_at');

        $country = NewCountryPeer::retrieveByPK($id);
        if (!$country) {
            $country = new NewCountry();
            $country->setId($id);
        }
        $country->setArName($ar_name);
        $country->setEnName($en_name);
        $country->setUpdatedAt($updated_at);
        $country->save();
    } catch (Exception $ex) {
        throw new SoapFault("Server", $ex->getMessage());
    }
    //$this->result = array('Status' => '', 'Id' => $id);
    $this->result = $country->getEnName();

    return sfView::SUCCESS;
}

client Side: $client = new SoapClient("http://localhost/sync/web/DataApi.php?wsdl"); try { $result = $client->setCountry(55, 'Ahmad', 'Ahmad', '0001-00-00 00:00:00'); print_r($result);

} catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; }

Can You Help Me?