Blame | Last modification | View Log | RSS feed
<?php#指派命名空間namespace qbpwcf;#匯入專屬SOAP的套件include("../allInOneForSOAP.php");/*#提示執行的函數echo "<hr>soap::callService=>local=>soap::demoService - testCase 1<p>";#涵式說明:#呼叫WebService#回傳的結果#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.#$reuslt["error"],執行不正常結束的錯訊息陣列.#$result["function"],當前執行的函式名稱.#$result["content"],呼叫完WebService所得回傳結果.#必填的參數:#$conf["servicePhpFile"],字串,提供服務內容的php檔案的完整絕對位置,裏面要有1個名爲 $conf["serviceClassName"] 類別$conf["servicePhpFile"]="qbpwcf/soap-soap.php";#$conf["soapMethod"],字串,要呼叫的方法$conf["soapMethod"]="demoService";#$conf["argv"],字串陣列,呼叫方法時所要用到的參數內容$sendedData["argv1"]="Hello!";$sendedData["argv2"]="How are you?";$conf["argv"]=array($sendedData);#呼叫方法時所要用到的參數內容#可省略的參數:#$conf["ssl"],字串,是否使用ssl,"true"代表要使用;"false"代表不使用,預設爲"false"$conf["ssl"]="true";#$conf["serverIp"],字串,服務提供的主機ip位置,預設爲本機"127.0.0.1"$conf["serverIp"]="sock.qbpwcf.org";#$conf["port"],port通常不用ssl時為80,用ssl時為443.$conf["port"]="443";#參考資料:#http://www.cnblogs.com/chance1/archive/2009/04/08/1431949.html#http://www.php.net/manual/en/soapclient.soapcall.php$callService=soap::callService($conf);unset($conf);#如果呼叫失敗if($callService["status"]==="false"){#印出結果var_dump($callService);#結束程式exit;}#if end#印出收的回應var_dump($callService["content"]);*//*#提示執行的函數echo "<hr>soap::callService=>local=>soap::demoServiceDumpArgu - testCase 2<p>";#涵式說明:#呼叫WebService#回傳的結果#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.#$reuslt["error"],執行不正常結束的錯訊息陣列.#$result["function"],當前執行的函式名稱.#$result["content"],呼叫完WebService所得回傳結果.#必填的參數:#$conf["servicePhpFile"],字串,提供服務內容的php檔案的完整絕對位置,裏面要有1個名爲 $conf["serviceClassName"] 類別$conf["servicePhpFile"]="qbpwcf/soap-soap.php";#$conf["soapMethod"],字串,要呼叫的方法$conf["soapMethod"]="demoServiceDumpArgu";#$conf["argv"],字串陣列,呼叫方法時所要用到的參數內容$sendedData["argv1"]="Hello!";$sendedData["argv2"]="How are you?";$sendedData["argv3"]="Today is a good day";$conf["argv"]=array($sendedData);#呼叫方法時所要用到的參數內容#可省略的參數:#$conf["ssl"],字串,是否使用ssl,"true"代表要使用;"false"代表不使用,預設爲"false"$conf["ssl"]="true";#$conf["serverIp"],字串,服務提供的主機ip位置,預設爲本機"127.0.0.1"$conf["serverIp"]="sock.qbpwcf.org";#$conf["port"],port通常不用ssl時為80,用ssl時為443.$conf["port"]="443";#參考資料:#http://www.cnblogs.com/chance1/archive/2009/04/08/1431949.html#http://www.php.net/manual/en/soapclient.soapcall.php$callService=soap::callService($conf);unset($conf);#如果呼叫失敗if($callService["status"]==="false"){#印出結果var_dump($callService);#結束程式exit;}#if end#印出收的回應var_dump($callService["content"]);*//*#提示執行的函數echo "<hr>soap::callService=>remote=>soap::demoService - testCase 3<p>";#涵式說明:#呼叫WebService#回傳的結果#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.#$reuslt["error"],執行不正常結束的錯訊息陣列.#$result["function"],當前執行的函式名稱.#$result["content"],呼叫完WebService所得回傳結果.#必填的參數:#$conf["servicePhpFile"],字串,提供服務內容的php檔案的完整絕對位置,裏面要有1個名爲 $conf["serviceClassName"] 類別$conf["servicePhpFile"]="~qbpwcf/samplePage/phplib/qbpwcf/soap-soap.php";#$conf["soapMethod"],字串,要呼叫的方法$conf["soapMethod"]="demoService";#$conf["argv"],字串陣列,呼叫方法時所要用到的參數內容$sendedData["argv1"]="Hello!";$sendedData["argv2"]="How are you?";$conf["argv"]=array($sendedData);#$conf["argv"]=array($sendedData);#呼叫方法時所要用到的參數內容#可省略的參數:#$conf["ssl"],字串,是否使用ssl,"true"代表要使用;"false"代表不使用,預設爲"false"$conf["ssl"]="true";#$conf["pem"],字串,用於tls的憑證位置.$conf["pem"]="../pem/tls-ca-bundle.pem";#$conf["serverIp"],字串,服務提供的主機ip位置,預設爲本機"127.0.0.1"$conf["serverIp"]="169.254.1.2";#$conf["port"],port通常不用ssl時為80,用ssl時為443.#$conf["port"]="8080";#參考資料:#http://www.cnblogs.com/chance1/archive/2009/04/08/1431949.html#http://www.php.net/manual/en/soapclient.soapcall.php$callService=soap::callService($conf);unset($conf);#如果呼叫失敗if($callService["status"]==="false"){#印出結果var_dump($callService);#結束程式exit;}#if end#印出收的回應var_dump($callService["content"]);*/?>