title: Using Typo3 eID for nusoap call
body: <p>i'm using the following code for my soap call. </p>
  
  <p>If i add the wsdl and make my client call i just get the response without the whole soap wrap. </p>
  
  <pre><code>declare(strict_types=1);
  namespace Vendor\DocBasics\Controller;
  
  use Psr\Http\Message\ResponseInterface;
  use Psr\Http\Message\ServerRequestInterface;
  use Psr\Http\Server\MiddlewareInterface;
  use Psr\Http\Server\RequestHandlerInterface;
  
  use TYPO3\CMS\Extbase\Object\ObjectManager;
  use TYPO3\CMS\Core\Localization\LanguageService;
  use TYPO3\CMS\Core\Utility\GeneralUtility;
  use Vendor\DocBasics\Domain\Repository\EventsRepository;
  use Vendor\CartExtended\Domain\Repository\Order\ItemRepository;
  
  require_once(PATH_site . 'typo3conf/ext/doc_basics/Classes/Libs/nusoap/nusoap.php');
  
  class EventsController
  {
  protected $action = '';
  protected $order;
  protected $Vbeln = '';
  protected $Zaehl = '';
  protected $objectManager;
  
  /**
   * @var array
   */
  protected $responseArray = [
      'hasErrors' =&gt; false,
      'message' =&gt; 'Nothing to declare'
  ];
  
  /**
   * @param ServerRequestInterface $request
   * @param ResponseInterface $response
   * @return ResponseInterface
   */
  public function processRequest(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface
  {
      $this-&gt;initializeData(file_get_contents('php://input')); //xml datas from soap call
  
      switch (isset($request-&gt;getQueryParams()['action']) ? (string)$request-&gt;getQueryParams()['action'] : '') {
          case 'create':
              $this-&gt;createAction();
              break;
          case 'update':
              $this-&gt;updateAction();
              break;
          default:
              $this-&gt;updateAction(); //call it as default, so i can call it as endpoint without action parameter
      }
      $this-&gt;prepareResponse($response,$request-&gt;getQueryParams()['action']);
      return $response;
  }
  
  /**
   * action create
   *
   * @return void
   */
  public function createAction()
  {
  
      $server = new \soap_server();
      $server-&gt;configureWSDL("updateorderservice", "https://domain.tld/updateorderservice", "https://domain.tld/index.php?eID=update_order");
      $server-&gt;register(
          "update",
          array("Vbeln" =&gt; 'xsd:string', "Zaehl" =&gt; 'xsd:integer'),
          array("return" =&gt; 'xsd:string'),
          "https://domain.tld/updateorderservice",
          "update",
          "rpc",
          "encoded",
          "Update a given order"
      );
  
      $this-&gt;responseArray['message']= $server-&gt;service(file_get_contents('php://input'));
  
  }
  
  public function updateAction() 
  {
      $this-&gt;objectManager = GeneralUtility::makeInstance(ObjectManager::class);
      $this-&gt;itemRepository = $this-&gt;objectManager-&gt;get(ItemRepository::class);
  
      $order=$this-&gt;itemRepository-&gt;findOrderByOrder($this-&gt;Vbeln);
  
      if($order){
          $order-&gt;setCancelDate($this-&gt;Veindat);
          $this-&gt;itemRepository-&gt;update($order);
          $this-&gt;persistenceManager-&gt;persistAll();
          $msg= '&lt;MESSAGE&gt;&lt;TYPE&gt;S&lt;/TYPE&gt;&lt;MSGTXT&gt;Auftrag '.$this-&gt;Vbeln.' aktualisiert!&lt;/MSGTXT&gt;&lt;/MESSAGE&gt;';
      }
      else $msg= '&lt;MESSAGE&gt;&lt;TYPE&gt;E&lt;/TYPE&gt;&lt;MSGTXT&gt;Auftrag '.$this-&gt;Vbeln.' konnte nicht aktualisiert!&lt;/MSGTXT&gt;&lt;/MESSAGE&gt;';
  
      $this-&gt;responseArray['message'] = $msg; //receive the message but don't know how to wrap it
  }
  
  /**
   * @param ResponseInterface $response
   * @param String $action
   * @return void
   */
  protected function prepareResponse(ResponseInterface &amp;$response, $action)
  {
      if($action=='create'){
          $response = $response-&gt;withHeader('Content-Type', 'text/html; charset=utf-8');
          $response-&gt;getBody()-&gt;write($this-&gt;responseArray['message']);
      }
      else{
          $response = $response-&gt;withHeader('Content-Type', 'text/xml; charset=utf-8'); 
          $response-&gt;getBody()-&gt;write($this-&gt;responseArray['message']);
      }
  }
  
  /**
   * @param  $request
   * @return void
   */
  protected function initializeData($request)
  {
      $resp= $this-&gt;parseResult($request);
      if($resp-&gt;Vbeln[0]) $this-&gt;Vbeln  = (string)($resp-&gt;Vbeln[0]);
      if($resp-&gt;Zaehl[0]) $this-&gt;Zaehl  = intval($resp-&gt;Zaehl[0]);
  }
  
  public function parseResult($result){
      $result = str_ireplace(['soapenv:','soap:','upd:'], '', $result);
      $result = simplexml_load_string($result);
      $notification = $result-&gt;Body-&gt;Update;
      return $notification;
  }
   }
  </code></pre>
  
  <p>My response is just the small xml i'm writing as return to the updateAction(). My response should be wrapped between  and so on
  May be i'm missing something or the way i'm using the eID concept is wrong.</p>