コード例 #1
0
 /**
  * Get a BusinessObject
  *
  * @return \AppBundle\Entity\BusinessObject
  */
 public function getBusinessObject()
 {
     $businessObject = new BusinessObject();
     $businessObject->setFirstValue('my first value');
     $businessObject->setSecondValue('my second value');
     return $businessObject;
 }
コード例 #2
0
 /**
  * @Route("/", name="soap_client")
  */
 public function soapClientAction()
 {
     $soapClientOptions = array('classmap' => array('BusinessObject' => BusinessObject::class), 'trace' => true, 'cache_wsdl' => WSDL_CACHE_NONE);
     $soapClient = new SoapClient($this->generateUrl('soap_server', array('wsdl' => ''), UrlGeneratorInterface::ABSOLUTE_URL), $soapClientOptions);
     $response = $soapClient->getBusinessObject();
     echo 'Response to getBusinessObject:';
     var_dump($response);
     echo '<br />' . PHP_EOL;
     $businessObject = new BusinessObject();
     $businessObject->setFirstValue('i have a first value');
     $businessObject->setSecondValue('i have a second value');
     $response = $soapClient->getFirstValueFromBusinessObject($businessObject);
     echo 'Response to getFirstValueFromBusinessObject:';
     var_dump($response);
     echo '<br />' . PHP_EOL;
     exit;
 }