亚洲免费乱码视频,日韩 欧美 国产 动漫 一区,97在线观看免费视频播国产,中文字幕亚洲图片

      1. <legend id="ppnor"></legend>

      2. 
        
        <sup id="ppnor"><input id="ppnor"></input></sup>
        <s id="ppnor"></s>

        順豐BSP訂單號(hào)查詢(xún)接口SOAP的請(qǐng)求示例

        字號(hào):


            在一些接口的設(shè)計(jì)中有時(shí)用到了SOAP方式的請(qǐng)求,比如順豐BSP的接口。
            我嘗試不同方式的POST方式請(qǐng)求,要么完全請(qǐng)求不到東西,要么接收到亂碼,均以失敗告終。
            針對(duì)順豐接口的SOAP請(qǐng)求的核心代碼分享如下:
            代碼如下:
            >
            /**
            * 發(fā)送soap請(qǐng)求
            */
            private function _soap()
            {
            $client = new SoapClient($this->serviceUrl);
            $info = new stdClass();
            $info->arg0 = $this->xml;
            $param = array($info);
            $response = $client->__call(“sfexpressService”,$param);
            return $response->return ;
            }
            /**
            * 拼接出請(qǐng)求的xml
            */
            public function createXml()
            {
            $xml = ‘<Request service=”RouteService” lang=”zh-CN”>
            <Head>’.$this->user.’,’.$this->passWord.’</Head>
            <Body>
            <RouteRequest tracking_type=”1″ method_type=”1″ tracking_number=”‘.$this->invoice_no.’” />
            </Body>
            </Request>’;
            $this->xml = $xml;
            }
            提示:
            1.$this->serviceUrl 順豐分配的BSP請(qǐng)求地址,注意是?wsdl的地址
            2.$this->user,$this->passWord 即是順豐分配的ID和校驗(yàn)碼
            3.返回的return是一個(gè)XML的String,你可能需要simplexml_load_string來(lái)解析。