| 14 |
liveuser |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/*
|
|
|
4 |
|
|
|
5 |
QBPWCF, Quick Build PHP website Component base on Fedora Linux.
|
|
|
6 |
Copyright (C) 2015 Min-Jhin,Chen
|
|
|
7 |
|
|
|
8 |
This file is part of QBPWCF.
|
|
|
9 |
|
|
|
10 |
QBPWCF is free software: you can redistribute it and/or modify
|
|
|
11 |
it under the terms of the GNU General Public License as published by
|
|
|
12 |
the Free Software Foundation, either version 3 of the License, or
|
|
|
13 |
(at your option) any later version.
|
|
|
14 |
|
|
|
15 |
QBPWCF is distributed in the hope that it will be useful,
|
|
|
16 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
17 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
18 |
GNU General Public License for more details.
|
|
|
19 |
|
|
|
20 |
You should have received a copy of the GNU General Public License
|
|
|
21 |
along with QBPWCF. If not, see <http://www.gnu.org/licenses/>.
|
|
|
22 |
|
|
|
23 |
*/
|
|
|
24 |
|
|
|
25 |
#使用命名空間qbpwcf
|
|
|
26 |
namespace qbpwcf{
|
|
|
27 |
|
|
|
28 |
#匯入外部套件
|
|
|
29 |
include("../allInOneForSOAP.php");
|
|
|
30 |
|
|
|
31 |
#提示執行的函數
|
|
|
32 |
echo "<hr>soap::callService=>local=>analyse::changeMultiChoiceToSingleChoice<p>";
|
|
|
33 |
|
|
|
34 |
/*
|
|
|
35 |
|
|
|
36 |
#涵式說明:
|
|
|
37 |
#呼叫WebService
|
|
|
38 |
#回傳的結果
|
|
|
39 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
40 |
#$reuslt["error"],執行不正常結束的錯訊息陣列.
|
|
|
41 |
#$result["function"],當前執行的函式名稱.
|
|
|
42 |
#$result["content"],呼叫完WebService所得回傳結果.
|
|
|
43 |
#$result["info"],取得webService的要求資訊.
|
|
|
44 |
#必填的參數:
|
|
|
45 |
#$conf["servicePhpFile"],字串,提供服務內容的php檔案的完整絕對位置,裏面要有1個名爲 $conf["serviceClassName"] 類別
|
|
|
46 |
$conf["servicePhpFile"]="~qbpwcf/samplePage/phplib/qbpwcf/analyse-soap.php";
|
|
|
47 |
#$conf["soapMethod"],字串,要呼叫的方法
|
|
|
48 |
$conf["soapMethod"]="changeMultiChoiceToSingleChoice";
|
|
|
49 |
|
|
|
50 |
#涵式說明
|
|
|
51 |
#將逗號分隔的字串 "1,2,5,7" 變成 "1,1,0,0,1,0,1"
|
|
|
52 |
#回傳的結果:
|
|
|
53 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
54 |
#$result["error"],錯誤訊息陣列.
|
|
|
55 |
#$result["function"],當前執行的函數名稱.
|
|
|
56 |
#$result["content"],分割好的字串
|
|
|
57 |
#必填的參數:
|
|
|
58 |
$changeMultiChoiceToSingleChoice["stringData"]="1,2,5,7";#類似"1,2,5,7"的字串
|
|
|
59 |
#可省略的參數:
|
|
|
60 |
#$conf["optionNameArray"]=array("a1,a2,a3,b1,b2,c1,d1,d2,d3,e");#選項的名稱依序爲?
|
|
|
61 |
#function changeMultiChoiceToSingleChoice($conf){
|
|
|
62 |
|
|
|
63 |
#$conf["argv"],字串陣列,呼叫方法時所要用到的參數內容
|
|
|
64 |
$conf["argv"]=array($changeMultiChoiceToSingleChoice);
|
|
|
65 |
#可省略的參數:
|
|
|
66 |
#$conf["ssl"],字串,是否使用ssl,"true"代表要使用;"false"代表不使用,預設爲"false"
|
|
|
67 |
#$conf["ssl"]="false";
|
|
|
68 |
#$conf["serverIp"],字串,服務提供的主機ip位置,預設爲本機"127.0.0.1"
|
|
|
69 |
#$conf["serverIp"]="127.0.0.1";
|
|
|
70 |
#$conf["port"],port通常不用ssl時為80,用ssl時為443.
|
|
|
71 |
#$conf["port"]="443";
|
|
|
72 |
#備註:
|
|
|
73 |
#若$conf["ssl"]設為"true"將會呼叫失敗.
|
|
|
74 |
#目前無法用非80port呼叫主機的服務.
|
|
|
75 |
#參考資料:
|
|
|
76 |
#http://www.cnblogs.com/chance1/archive/2009/04/08/1431949.html
|
|
|
77 |
#http://www.php.net/manual/en/soapclient.soapcall.php
|
|
|
78 |
var_dump(soap::callService($conf));
|
|
|
79 |
unset($conf);
|
|
|
80 |
nuset($changeMultiChoiceToSingleChoice);
|
|
|
81 |
|
|
|
82 |
*/
|
|
|
83 |
|
|
|
84 |
#提示執行的函數
|
|
|
85 |
echo "<hr>soap::callService=>remote=>analyse::changeMultiChoiceToSingleChoice<p>";
|
|
|
86 |
|
|
|
87 |
/*
|
|
|
88 |
|
|
|
89 |
#涵式說明:
|
|
|
90 |
#呼叫WebService
|
|
|
91 |
#回傳的結果
|
|
|
92 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
93 |
#$reuslt["error"],執行不正常結束的錯訊息陣列.
|
|
|
94 |
#$result["function"],當前執行的函式名稱.
|
|
|
95 |
#$result["content"],呼叫完WebService所得回傳結果.
|
|
|
96 |
#$result["info"],取得webService的要求資訊.
|
|
|
97 |
#必填的參數:
|
|
|
98 |
#$conf["servicePhpFile"],字串,提供服務內容的php檔案的完整絕對位置,裏面要有1個名爲 $conf["serviceClassName"] 類別
|
|
|
99 |
$conf["servicePhpFile"]="~qbpwcf/samplePage/phplib/qbpwcf/analyse-soap.php";
|
|
|
100 |
#$conf["soapMethod"],字串,要呼叫的方法
|
|
|
101 |
$conf["soapMethod"]="changeMultiChoiceToSingleChoice";
|
|
|
102 |
|
|
|
103 |
#涵式說明
|
|
|
104 |
#將逗號分隔的字串 "1,2,5,7" 變成 "1,1,0,0,1,0,1"
|
|
|
105 |
#回傳的結果:
|
|
|
106 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
107 |
#$result["error"],錯誤訊息陣列.
|
|
|
108 |
#$result["function"],當前執行的函數名稱.
|
|
|
109 |
#$result["content"],分割好的字串
|
|
|
110 |
#必填的參數:
|
|
|
111 |
$changeMultiChoiceToSingleChoice["stringData"]="1,2,5,7";#類似"1,2,5,7"的字串
|
|
|
112 |
#可省略的參數:
|
|
|
113 |
#$conf["optionNameArray"]=array("a1,a2,a3,b1,b2,c1,d1,d2,d3,e");#選項的名稱依序爲?
|
|
|
114 |
#function changeMultiChoiceToSingleChoice($conf){
|
|
|
115 |
|
|
|
116 |
#$conf["argv"],字串陣列,呼叫方法時所要用到的參數內容
|
|
|
117 |
$conf["argv"]=array($changeMultiChoiceToSingleChoice);
|
|
|
118 |
#可省略的參數:
|
|
|
119 |
#$conf["ssl"],字串,是否使用ssl,"true"代表要使用;"false"代表不使用,預設爲"false"
|
|
|
120 |
#$conf["ssl"]="false";
|
|
|
121 |
#$conf["serverIp"],字串,服務提供的主機ip位置,預設爲本機"127.0.0.1"
|
|
|
122 |
$conf["serverIp"]="169.254.4.3";
|
|
|
123 |
#$conf["port"],port通常不用ssl時為80,用ssl時為443.
|
|
|
124 |
#$conf["port"]="443";
|
|
|
125 |
#備註:
|
|
|
126 |
#若$conf["ssl"]設為"true"將會呼叫失敗.
|
|
|
127 |
#目前無法用非80port呼叫主機的服務.
|
|
|
128 |
#參考資料:
|
|
|
129 |
#http://www.cnblogs.com/chance1/archive/2009/04/08/1431949.html
|
|
|
130 |
#http://www.php.net/manual/en/soapclient.soapcall.php
|
|
|
131 |
var_dump(soap::callService($conf));
|
|
|
132 |
unset($conf);
|
|
|
133 |
unset($changeMultiChoiceToSingleChoice);
|
|
|
134 |
|
|
|
135 |
*/
|
|
|
136 |
|
|
|
137 |
}#namespace qbpwcf end
|
|
|
138 |
|
|
|
139 |
?>
|