ServerFactory.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * Factory to create new SoapServer objects.
  4. *
  5. * Copyright © Magento, Inc. All rights reserved.
  6. * See COPYING.txt for license details.
  7. */
  8. namespace Magento\Webapi\Model\Soap;
  9. class ServerFactory
  10. {
  11. /**
  12. * @var \Magento\Framework\ObjectManagerInterface
  13. * @deprecated 100.1.0
  14. */
  15. protected $_objectManager;
  16. /**
  17. * @var \Magento\Webapi\Controller\Soap\Request\Handler
  18. */
  19. protected $_soapHandler;
  20. /**
  21. * Initialize the class
  22. *
  23. * @param \Magento\Framework\ObjectManagerInterface $objectManager
  24. * @param \Magento\Webapi\Controller\Soap\Request\Handler $soapHandler
  25. */
  26. public function __construct(
  27. \Magento\Framework\ObjectManagerInterface $objectManager,
  28. \Magento\Webapi\Controller\Soap\Request\Handler $soapHandler
  29. ) {
  30. $this->_objectManager = $objectManager;
  31. $this->_soapHandler = $soapHandler;
  32. }
  33. /**
  34. * Create SoapServer
  35. *
  36. * @param string $url URL of a WSDL file
  37. * @param array $options Options including encoding, soap_version etc
  38. * @return \SoapServer
  39. */
  40. public function create($url, $options)
  41. {
  42. $soapServer = new \SoapServer($url, $options);
  43. $soapServer->setObject($this->_soapHandler);
  44. return $soapServer;
  45. }
  46. }