这个/任何SOAP调用都需要'allow_url_fopen'吗?

时间:2015-04-22 09:29:12

标签: php curl soap soap-client

有人可以告诉我,如果'allow_url_fopen'需要设置为yes / on,以便执行如下所示的SOAP调用。

如果有人想要了解我为什么要这样做的更多信息,我可以提供更多但是我想在这个阶段保持简单的问题,因为我正在试图弄清楚'allow_url_fopen'是否是必需的我正在努力做什么。

如果需要,有人可以让我知道哪个部分特别需要'allow_url_fopen'部分以及我如何使用其他类似cURL的东西来完成我在这里尝试做的事情。

先谢谢你们。

$username = 'xxxxxxx@xxxxxxx.com';
$password = 'xxxxxxxx';

$profile_id = 'xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx';

$wsdl = 'https://pilot.id3global.com/ID3gWS/ID3global.svc?wsdl';

class clsWSSEAuth { 
        private $Username; 
        private $Password;  
        function __construct($username, $password) { 
            $this->Username=$username; 
            $this->Password=$password; 
        } 
    } 

    class clsWSSEToken { 
        private $UsernameToken; 
        function __construct ($UsernameToken) { 
            $this->UsernameToken = $UsernameToken; 
        } 
    } 

    $strWSSENS = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"; 

    //Auth
    $objSoapVarUser = new SoapVar($username, XSD_STRING, NULL, $strWSSENS, NULL, $strWSSENS); 
    $objSoapVarPass = new SoapVar($password, XSD_STRING, NULL, $strWSSENS, NULL, $strWSSENS); 
    $objWSSEAuth = new clsWSSEAuth($objSoapVarUser, $objSoapVarPass); 

    //Token
    $objSoapVarWSSEToken = new SoapVar($objWSSEAuth, SOAP_ENC_OBJECT, NULL, $strWSSENS, 'UsernameToken', $strWSSENS); 
    $objWSSEToken = new clsWSSEToken($objSoapVarWSSEToken); 

    //Header
    $objSoapVarWSSEAuth = new SoapVar($objWSSEToken, SOAP_ENC_OBJECT, NULL, $strWSSENS, 'UsernameToken', $strWSSENS); 
    $objSoapVarHeaderVal = new SoapVar($objSoapVarWSSEAuth, SOAP_ENC_OBJECT, NULL, $strWSSENS, 'Security', $strWSSENS); 
    $objSoapVarWSSEHeader = new SoapHeader($strWSSENS, 'Security', $objSoapVarHeaderVal, true); 

    //Client
    $client = new SoapClient($wsdl, array(
        'soap_version' => SOAP_1_1, 
        'trace' => 1, 
        'exception' => true, 
    )); 

    $client->__setSoapHeaders($objSoapVarWSSEHeader);

    // Build data array to use for AML check
    $data = array(xxxxxxxxxxxxx);

// Run the check
    $applicant_1_aml = FALSE;
    try {
        $result = $client->AuthenticateSP(array(
            'ProfileIDVersion' => array('ID' => $profile_id),
            'InputData' => $data,
        ));
        $applicant_1_aml = TRUE;
        $applicant_1_band = $result->AuthenticateSPResult->BandText;
        $applicant_1_score = $result->AuthenticateSPResult->Score;
    } catch(Exception $e) {
        throw $e;
        //var_dump($e);
    }

0 个答案:

没有答案