71 private $wsdlGenerator;
92 \
Magento\Framework\Reflection\TypeProcessor $typeProcessor,
96 if (!extension_loaded(
'soap')) {
97 throw new \Magento\Framework\Webapi\Exception(
98 __(
'SOAP extension is not loaded.'),
103 $this->_areaList = $areaList;
104 $this->_configScope = $configScope;
107 $this->_soapServerFactory = $soapServerFactory;
108 $this->_typeProcessor = $typeProcessor;
109 $this->_scopeConfig = $scopeConfig;
110 $this->wsdlGenerator = $wsdlGenerator;
123 $soapServer = $this->_soapServerFactory->create($this->getWsdlLocalUri(),
$options);
124 $soapServer->handle($rawRequestBody);
134 private function getWsdlLocalUri()
136 $wsdlBody = $this->wsdlGenerator->generate(
137 $this->_request->getRequestedServices(),
138 $this->_request->getScheme(),
139 $this->_request->getHttpHost(),
142 return 'data://text/plain;base64,'.base64_encode($wsdlBody);
152 $charset = $this->_scopeConfig->getValue(
153 self::CONFIG_PATH_SOAP_CHARSET,
154 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE
167 $params = [self::REQUEST_PARAM_SERVICES => $this->_request->getParam(self::REQUEST_PARAM_SERVICES)];
184 : $this->_storeManager->getStore()->getCode();
185 return $this->_storeManager->getStore()->getBaseUrl()
186 . $this->_areaList->getFrontName($this->_configScope->getCurrentScope())
199 $dom = new \DOMDocument();
200 if (strlen($soapRequest) == 0 || !$dom->loadXML($soapRequest)) {
201 throw new \Magento\Framework\Webapi\Exception(
207 foreach ($dom->childNodes as $child) {
208 if ($child->nodeType === XML_DOCUMENT_TYPE_NODE) {
209 throw new \Magento\Framework\Webapi\Exception(
210 __(
'Invalid XML: Detected use of illegal DOCTYPE'),
const REQUEST_PARAM_LIST_WSDL
const SOAP_DEFAULT_ENCODING
__construct(\Magento\Framework\App\AreaList $areaList, \Magento\Framework\Config\ScopeInterface $configScope, Request $request, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Webapi\Model\Soap\ServerFactory $soapServerFactory, \Magento\Framework\Reflection\TypeProcessor $typeProcessor, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Webapi\Model\Soap\Wsdl\Generator $wsdlGenerator)
_checkRequest($soapRequest)
const REQUEST_PARAM_SERVICES
generateUri($isWsdl=false)
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
const CONFIG_PATH_SOAP_CHARSET