<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                YurunPHP內置Soap支持,可以搭配PHP的SoapServer類使用。 由于文字可能表述不清,大多數內容將以代碼形式展現。 #### 配置文件 添加自動加載 ~~~ 'AUTOLOAD_RULES' => array( array('type'=>'Word','word'=>'SoapControl','path'=>'Ex/Lib/Soap'), array('type'=>'Word','word'=>'SoapParser','path'=>'Ex/Lib/Soap'), array('type'=>'Word','word'=>'SoapProxy','path'=>'Ex/Lib/Soap'), array('type'=>'Word','word'=>'ClassToWsdl','path'=>'Ex/Lib/Soap/PHPWsdl'), array('type'=>'Word','word'=>'WSDL','path'=>'Ex/Lib/Soap/PHPWsdl'), ), ~~~ #### 控制器 ~~~ <?php class ServiceControl extends SoapControl { /** * 服務首頁動作名 */ protected $index = 'index'; /** * wsdl文檔動作名 */ protected $wsdl = 'wsdl'; /** * 服務接口執行動作名 */ protected $exec = 'exec'; /** * 服務接口測試頁面動作名 */ protected $test = 'test'; /** * wsdl中的Style */ protected $wsdlStyle = 'document'; /** * wsdl中的use */ protected $wsdlUse = 'literal'; /** * 是否啟用緩存 */ protected $cacheStatus = true; /** * 友好展示頁面 * @param mixed $serviceName * @return mixed */ public function index($serviceName) { $this->__index($serviceName); } /** * wsdl文件 * @param mixed $serviceName * @return mixed */ public function wsdl($serviceName) { $this->__wsdl($serviceName); } /** * webservice調用入口 * @param mixed $serviceName * @return mixed */ public function exec($serviceName) { $this->__exec($serviceName); } /** * 測試入口 * @param mixed $serviceName * @param mixed $methodName * @return mixed */ public function test($serviceName,$methodName) { $this->__test($serviceName,$methodName); } } ~~~ #### 路由 路由這一步其實無關緊要,使用默認的規則訪問也可以,如果想要Url美觀,可以參考我給的示例自行修改。 ~~~ 'rules' => array( 'Service/[serviceName:word]/[methodName:word]/test' => 'Test/Service/test', 'Service/[serviceName:word]/[action:word]' => 'Test/Service/$2', 'Service/[serviceName:word]' => 'Test/Service/index', ) ~~~ 這樣配置,路徑就是這樣的 > index:http://xxx.com/Service/服務名 > wsdl:http://xxx.com/Service/服務名/wsdl > exec:http://xxx.com/Service/服務名/exec > test:http://xxx.com/Service/服務名/方法名/test #### 服務文件 一般放在對應模塊的Lib目錄下 `Test.class.php` ~~~ <?php /** * 測試接口 * @namespace http://www.baidu.com/ */ class Test { /** * 加法1 * @soap * @param int $a1 數字1 * @param int $b1 數字2 * @return int */ public function add($a1,$b1) { return $a1 + $b1; } /** * 減法 * @soap * @param int $a 數字1 * @param int $b 數字2 * @return int[] */ public function sub($a,$b) { return array($a,$b); } public function test1() { } private function test2() { } } ~~~ > namespace可以自行修改 > 開放出來的soap方法只有add和sub,也就是依靠注釋來識別哪個是soap方法。 > 參數和返回值一定要詳細注釋,否則生成的wsdl不對,調用不出來。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看