Skip to content

Instantly share code, notes, and snippets.

@Musilda
Created April 20, 2023 05:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Musilda/11c52173251794e3f89cf8659e71533b to your computer and use it in GitHub Desktop.
Save Musilda/11c52173251794e3f89cf8659e71533b to your computer and use it in GitHub Desktop.
<?php
$password = 'xxxxxxx';
$wsdlUrl = 'https://xxxxxx:xxxx/xxxx/CardServiceWs?WSDL';
$pemFilePath = PATHDIR . 'client.pem';
$pemPassword = 'xxxxxxxxxxxxx';
$contextOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
$sslContext = stream_context_create( $contextOptions );
$params = [
'local_cert' => $pemFilePath,
'passphrase' => $pemPassword ,
'trace' => 1,
'exceptions' => 1,
'cache_wsdl' => WSDL_CACHE_NONE,
'stream_context' => $sslContext
];
try {
$soapClient = new \SoapClient( $wsdlUrl, $params );
}
catch(Exception $e) {
print_r($e->getMessage());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment