Example #1
0
function soap_call($success, $id, $msg, $url = null, $cdate = null)
{
    //建立SOAP
    // URL = http://www.keepon.com.tw/KeeponWS/Service1.asmx
    $soap = new SoapClient("http://www.keepon.com.tw/KeeponWebService.asmx?WSDL");
    //
    //    // 變數名稱必需與Web Service的變數名稱相同
    $params = array('Success' => $success, 'Identity' => $id, 'Date' => $cdate ? $cdate : date("Y-m-d H:i:s"), 'ImageUrl' => $url, 'Message' => $msg);
    try {
        //                              //呼叫 MapResult 傳入$params
        $result = $soap->MapResult($params);
        //取得回傳值
        kcli_msglog(array($params, $result));
        return array(true, $result);
    } catch (SoapFault $exception) {
        //
        kcli_msglog(array($params, "expection: {$exception}"));
        return array(false, $exception);
    }
}