コード例 #1
0
ファイル: class.chaxun.php プロジェクト: GStepOne/CI
 public function get_message()
 {
     ini_set('soap.wsdl_cache_enabled', 0);
     ini_set('soap.wsdl_cache_ttl', 0);
     $url = 'https://vpn.shanghai-cis.com.cn/+webvpn+/index.html';
     $post_data = array('tgroup' => '', 'next' => '', 'tgcookieset' => '', 'username' => 'shcljradmin', 'password' => 'xm8hwvax', 'Login' => '登录');
     $headers = array("Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Encoding:gzip, deflate", "Accept-Language:zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3", "Connection:keep-alive", "Cookie:webvpnx=; webvpnlogin=1; webvpn_state=7@B765E4B420124F7716AA4EA6E75577BC397E7B19; csc_next=%2F%2BCSCO\n%2B00756767633A2F2F6A6A6A2E617370662E70627A%2B%2B%2Fwebservice%2Fbatchcredit%3Fwsdl; webvpnlogin=1; webvpnLang=en", "Host:vpn.shanghai-cis.com.cn", "Referer:https://vpn.shanghai-cis.com.cn/+CSCOE+/logon.html", "User-Agent:Mozilla/5.0 (Windows NT 6.1; rv:39.0) Gecko/20100101 Firefox/39.0");
     $link = $this->curl($url, $headers, $post_data);
     $reg = '/webvpn=\\s*([^;]+);/is';
     if (preg_match_all($reg, $link['header'], $p)) {
         $cookiestr = implode(';', $p[1]);
     }
     /*
     $options = 	array(
     	'location'=>'',
     	'uri'=>'',
     	'login'=>'shcljradmin',
     	'password'=>'z9vpzzu0',
     	'trace'=>true,
     	'targetNamespace'=>'http://webservice.creditreport.p2p.sino.com/',
     	'cookies'=>array('webvpn='.$cookiestr)		
     );
     */
     $context = stream_context_create(array('ssl' => array('verify_peer' => false, 'allow_self_signed' => true)));
     $client = new SoapClientAuth("../../web/www/wsdl.txt", array('location' => 'https://vpn.shanghai-cis.com.cn/+CSCO+00756767633A2F2F6A6A6A2E61737066677266672E70627A3A38303830++/webservice/batchcredit?wsdl', 'uri' => 'https://vpn.shanghai-cis.com.cn/+CSCO+00756767633A2F2F6A6A6A2E61737066677266672E70627A3A38303830++/webservice/batchcredit?wsdl', 'login' => 'shcljradmin', 'password' => 'z9vpzzu0', 'trace' => true, 'targetNamespace' => 'http://webservice.creditreport.p2p.sino.com/', 'stream_context' => $context, 'cookies' => array('webvpn=' . $cookiestr)));
     //$client->__setCookie('webvpn',$cookiestr);
     // $u = new SoapHeader('http://webservice.creditreport.p2p.sino.com/','MySoapHeader',array('UserName'=>'shcljradmin','PassWord'=>'z9vpzzu0','Accept'=>'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8','Content-Type'=>'application/x-www-form-urlencoded'),false);
     //添加soapheader
     //$client->__setSoapHeaders($u);
     $param = array('orgcode' => 'Q10152900H5C00', 'secret' => '7lr9mgem', 'plate' => '1', 'certtype' => '0', 'certno' => '330823198205055517', 'name' => '王红华', 'reason' => '06', 'createtype' => '1');
     $ret = $client->queryCredit($param);
     $array = $this->objectToArray($ret);
     $result = json_decode($array['return'], true);
     var_Dump($result);
     //var_Dump($result[0]['result']);
     exit;
 }
コード例 #2
0
    /**
     * @return string
     */
    protected function startCourseOverWsdl()
    {
        $courseId    = ( isset( $_POST['courseid'] ) && filter_var($_POST['courseid'], FILTER_VALIDATE_REGEXP, SecurityTool::$ELEARNING_COURSEID_REGEXP) ) ? $_POST['courseid'] : null;
        
        $soapUrl            = SolrSafeOperatorHelper::feature('OnlineVortrageSettings', 'WsdlUrl');
        $credentialLogin    = SolrSafeOperatorHelper::feature('OnlineVortrageSettings', 'WsdlLogin');
        $credentialPassword = SolrSafeOperatorHelper::feature('OnlineVortrageSettings', 'WsdlPassword');
        $useLocale          = SolrSafeOperatorHelper::feature('OnlineVortrageSettings', 'UseLocale');
        $locale             = SolrSafeOperatorHelper::feature('OnlineVortrageSettings', 'Locale');
        
        $credentials = array(
            'login'    => $credentialLogin,
            'password' => $credentialPassword,
        );
        
        $params = array(
            array(
                'username' => MMUsers::getCurrentUserId(),
                'courseID' => $courseId,
            )
        );
        
        if ( $useLocale )
        {
            $params[0]['locale'] = $locale;
        }
        
        try
        {
            $soap   = new SoapClientAuth( $soapUrl, $credentials );
            $result = $soap->__soapCall( 'UnivadisEncrypt', $params );
            
            if ( isset($result) && isset($result->return) )
            {
                $url = $result->return;
                if ( strpos($url, 'http') !== 0 || strpos($url, 'https') !== 0)
                {
                    $url = 'http://' . $url;
                }
                
                if ( !ContextTool::instance()->isMobile() )
                {
                    $url = urlencode( urlencode( $url ) );
                    $url = '/external/deeplink?deeplink=' . $url . '&exit_strategy=0';
                }
                
                return $url;
            }
        }
        catch ( SoapFault $f )
        {
        }

        return false;
    }