php https链接

时间:2014-05-16 22:29:01   收藏:0   阅读:435

1.安装soap扩展

2.安装openssL

3.代码执行

function  issure($sn){//通过soap链接接口  进行确认是否是正确的sn码
    try{
        $client = new SoapClient("https://112.122.122.22/gethtcpro.asmx?wsdl",array(‘soap_version‘=> SOAP_1_2,"trace"=>true,"exceptions"=>false,‘ssl_method‘=>3));

        $sn = $client->getstatusBysn(array(‘sn‘=>$sn));
        $pd=0;
        if($sn->getstatusBysnResult  === true){
            $pd=1;
        }else if($sn->getstatusBysnResult  === false){
            $pd=0;
        }else{
            $pd=0;
//            echo "未知".$sn->getstatusBysnResult;
        }
    }catch (SoapFault $e){
        $pd=0;
//        echo "未知".$sn->getstatusBysnResult;
    }
    return $pd;
}

php https链接,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!