Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $wsdl = 'PATH/TO/WSDL';
- $url = 'http://URL_TO_SOAP_SERVICE';
- $cert = 'PATH/TO/CLIENT/CERT';
- $context = stream_context_create([
- 'ssl' => [
- 'crypto_method' => STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT,
- 'verify_peer' => true,
- 'verify_peer_name' => true,
- 'allow_self_signed' => false,
- 'cafile' => '/path/to/cafile.selfsigned'
- ]
- ]);
- $params = [
- 'location' => $url,
- 'local_cert' => $cert,
- 'trace' => true,
- 'exceptions' => true,
- 'verifypeer' => true,
- 'verifyhost' => true,
- 'allow_self_signed' => false,
- 'connection_timeout' => 180,
- 'keep_alive' => false,
- 'stream_context' => $context
- ];
- $client = new SoapClient($wsdl, $params)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement