<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、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                引入方倍 ————[PHP5調用SOAP訪問接口](https://www.cnblogs.com/txw1958/p/php5-soap-wsdl.html) # 一、基礎概念 > SOAP(Simple Object Access Protocol )簡單對象訪問協議是在分散或分布式的環境中交換信息的簡單的協議,是一個基于XML的協議,它包括四個部分:SOAP封裝(envelop),封裝定義了一個描述消息中的內容是什么,是誰發送的,誰應當接受并處理它以及如何處理它們的框架;SOAP編碼規則(encoding rules),用于表示應用程序需要使用的數據類型的實例; SOAP RPC表示(RPC representation),表示遠程過程調用和應答的協定;SOAP綁定(binding),使用底層協議交換信息。 > WSDL(Web Service Description Language)就是描述XML Web服務的標準XML格式,WSDL由Ariba、Intel、IBM和微軟等開發商提出。它用一種和具體語言無關的抽象方式定義了給定Web服務收發的有關操作和消息。就其定義來說,你還不能把WSDL當作一種對象接口定義語言,例如,CORBA或COM等應用程序體系結構就會用到對象接口定義語言。 WSDL保持協議中立,但它確實內建了綁定SOAP的支持,從而同SOAP建立了不可分割的聯系。所以,當我在這篇文章中討論WSDL的時候,我會假定你把SOAP作為了你的通訊協議。 > SOAP和WSDL雖然是web service的兩大標準,但是兩者并沒有必然的聯系,都可以獨立使用。它們之間的關系就類似HTTP和Html之間的關系。前者是一種協議,后者是對一個Web Server的描述。 * * * * * #二、PHP5下的配置 在php的的配置文件php.ini中,找到 > extension=php_soap.dll > # 三、查詢web service方法與參數、數據類型 > 某省電信公司的入單接口為http://***.******.com/services/AcceptedBusiness?wsdl 我們使用SoapClient的__geunctions()和__getTypes()方法查看該接口的方法,參數和數據類型 只有__getFunctions中列出的接口才能被soap調用。 在根目錄下創建代碼soap.php ~~~ <?php header("content-type:text/html;charset=utf-8"); try { $client = new SoapClient("http://***.******.com/services/AcceptedBusiness?wsdl"); print_r($client->__getFunctions()); print_r($client->__getTypes()); } catch (SOAPFault $e) { print $e; } ?> ~~~ 在瀏覽器運行:http://localhost/soap.php后,返回結果如下 ~~~ Array ( [0] => ArrayOf_xsd_anyType introduceAcceptedBusiness(string $c3, string $c4, string $linkman, string $linknum, string $num, string $idcard, string $remark, string $address) [1] => ArrayOf_xsd_anyType introduceAcceptedBusinessByAiZhuangWei(string $subname, string $linkphone, string $idcard, string $address, string $businesstype, string $marketcode, string $surveycode, string $commanager, string $commanagerphone, string $bendiwang, string $fenju, string $zhiju, string $remark) [2] => string introduceAcceptedBusinessByStandardInterface(string $xmlStr) [3] => string introduceAcceptedBusinessByCallOut(string $xmlStr) [4] => string introduceAcceptedBusinessByYddj(string $xmlParam) [5] => ArrayOf_xsd_anyType queryAcceptedBusinessByAiZhuangWei(string $surveycode, string $starttime, string $endtime) [6] => string queryCallOutOrderByConfig(string $xmlParam) ) Array ( [0] => anyType ArrayOf_xsd_anyType[] ) ~~~ 其中有個方法 introduceAcceptedBusinessByStandardInterface(string $xmlStr),將是開發文檔中提到的要使用的接口,參數為xml字符串 另外有的接口中提到有SoapHeader認證,這就需要加入__setSoapHeaders方法,具體可查看http://php.net/manual/zh/soapclient.setsoapheaders.php # 四、提交入單 > 這一步就是需要根據開發文檔拼接xml字符串,然后作為introduceAcceptedBusinessByStandardInterface的參數傳入 創建acceptedbusiness.php,內容如下 ~~~ <?php header("content-type:text/html;charset=utf-8"); try { $client = new SoapClient('http://***.*******.com/services/AcceptedBusiness?wsdl'); $xml = " <?xml version='1.0' encoding='UTF-8' ?> <PACKAGE> <C3>**電信</C3> <C4></C4> <LINKMAN>張三</LINKMAN> <LINKNUM>13412341234</LINKNUM> <LINKADDRESS>廣東深圳</LINKADDRESS> <REMARK>iPhone 6</REMARK> <CHANNEL></CHANNEL> <GRIDCODE>1111111111111111111111111111111</GRIDCODE> <AGENTCODE>2111</AGENTCODE> <KEY>1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111</KEY> </PACKAGE> "; $return = $client->introduceAcceptedBusinessByStandardInterface($xml); print_r($return); } catch (SOAPFault $e) { print_r('Exception:'.$e); } ?> ~~~ 在瀏覽器中執行后,返回 ~~~ <?xml version="1.0" encoding="UTF-8"?> <PACKAGE> <STATUS>0</STATUS> <REASON>入單成功!</REASON> <ORDERSEQ>2014100905523549742</ORDERSEQ> </PACKAGE> ~~~
                  <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>

                              哎呀哎呀视频在线观看