0
私はSoapクライアントサービスを使用していますが、ポリシーで拒否されましたというエラーが表示されています。 (クライアントから)。私もpemファイルを適切にインクルードしました。 pemファイルでは、秘密鍵と証明書のキーを以下の形式で追加しました。これは私が信じるところでは完璧です。ポリシーによって拒否されたPHP。 (クライアントから)
ポリシーで拒否されました - エラーを修正するのを手伝ってください。以下は、(クライアントから)
-----BEGIN RSA PRIVATE KEY----- and -----END RSA PRIVATE KEY----- show a private key in PEM format.
-----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- show a certificate file in PEM format.
私のコードです:
<?php
$path_to_wsdl = "https://webservicesgatewaytest.sprint.com:444/rtb2/services/wireless/account/ContactPreferenceManagementService/v1?wsdl";
ini_set("soap.wsdl_cache_enabled", "0");
$local_cert = "trocglobal-01-pub.pem";
$client = new SoapClient($path_to_wsdl, array('local_cert'=> $local_cert,'trace' => 1,'encoding' => 'UTF-8')); // Refer to http://us3.php.net/manual/en/ref.soap.php for more information
$headerBody['trackingMessageHeader'] = array(
'applicationId'=>'ENGE',
'applicationUserId' => 'ENGE',
'consumerId' => 'engage',
'messageId' => rand(100000,500000),
'timeToLive' => 600,
'messageDateTimeStamp' => date("c")
);
$request = array(
'globalPreferenceList' => array(
'globalPreferenceInfo' => array(
'contactType'=>'Phone',
'certifyRuleName' => 'SPRCFT01',
'contactTypeValueInfo' => array('mdn' => '7600763938'),
'campaignName' => 'SPRINT'
)
)
);
try {
$header = new SoapHeader('http://integration.sprint.com/eai/services/ContactPreferenceManagementService/v1/ContactPreferenceManagementService.wsdl',
'wsMessageHeader', // header name
$headerBody);
$client->__setSoapHeaders($header);
try {
//$response = $client->queryContactGlobalPreferences($request); // Soap web service invocation
$response = $client->__soapCall('QueryContactGlobalPreferences',array($request)); // Soap web service invocation
echo "<pre>";print_r($response);exit;
}
catch (Exception $e)
{
echo 'Caught exception: ', $e->getMessage(), "\n";
}
if ($response->HighestSeverity != 'FAILURE' && $response->HighestSeverity != 'ERROR'){
printSuccess($client, $response);
//fwrite($fp, $response->CompletedShipmentDetail->CompletedPackageDetails->Label->Parts->Image); //Create PNG or PDF file
}else{
printError($client, $response);
}
writeToLog($client); // Write to log file
} catch (SoapFault $exception) {
printFault($exception, $client);
}
?>