/**
  * @param Nexway\Data\Request $data
  *
  * @return string
  */
 private function sendRequest(Nexway\Data\Request $data)
 {
     $_wsdlHttpBinding = "";
     $_wsdlServiceName = "";
     if ($data->request instanceof Nexway\Data\Request\CatalogApi) {
         $_wsdlServiceName = "CatalogApi";
     } elseif ($data->request instanceof Nexway\Data\Request\OrderApi) {
         $_wsdlServiceName = "OrderApi";
     } elseif ($data->request instanceof Nexway\Data\Request\CustomerApi) {
         $_wsdlServiceName = "CustomerApi";
     }
     if (isset($this->config['service']['nexway']['url'][lcfirst($_wsdlServiceName)])) {
         $_wsdlHttpBinding = $this->config['service']['nexway']['url'][lcfirst($_wsdlServiceName)];
     }
     $client = new \Zend\Soap\Client();
     $client->setWSDL($_wsdlHttpBinding);
     $client->setOptions(array('soap_version' => SOAP_1_1));
     preg_match('/(?P<methodName>[^\\\\]+)$/i', get_class($data->request), $_matches);
     $methodName = $_matches['methodName'];
     return $client->{$methodName}($data);
 }
Example #2
0
 public function testSetWSDLGetWSDLWithSoapClient()
 {
     $wsdl = 'http://example.com/somewhere.wsdl';
     $mailMerge = new MailMerge();
     $soapClient = new \Zend\Soap\Client();
     $soapClient->setWSDL($wsdl);
     $mailMerge->setSoapClient($soapClient);
     $this->assertTrue($wsdl === $mailMerge->getWSDL());
     unset($mailMerge);
 }