getUserAgent(), self::DEFAULT_MAX_REDIRECTS, $soapClientOptions->getCompression(), self::DEFAULT_CONNECTION_TIMEOUT, $soapClientOptions->getProxy(), self::getHttpAuthOptions($soapClientOptions), self::getSslCertificateOptions($soapClientOptions) ); } private static function getHttpAuthOptions(SoapClientOptions $soapClientOptions) { if ($soapClientOptions->hasAuthentication()) { if ($soapClientOptions->hasAuthenticationBasic()) { /** @var SoapServerAuthenticationBasic $basicAuthentication */ $basicAuthentication = $soapClientOptions->getAuthentication(); return new HttpAuthenticationBasicOptions( $basicAuthentication->getLogin(), $basicAuthentication->getPassword() ); } else if ($soapClientOptions->hasAuthenticationDigest()) { return new HttpAuthenticationDigestOptions(); } else { throw new Exception('Unresolved authentication type: '.get_class($soapClientOptions->getAuthentication())); } } return null; } private static function getSslCertificateOptions(SoapClientOptions $soapClientOptions) { if ($soapClientOptions->hasAuthenticationDigest()) { /** @var SoapServerAuthenticationDigest $digestAuthentication */ $digestAuthentication = $soapClientOptions->getAuthentication(); return new SslCertificateOptions( $digestAuthentication->getLocalCert(), $digestAuthentication->getPassPhrase() ); } return null; } }