TYPO3 Extbase 肥皂客户端

TYPO3 Extbase soap client

如何在 TYPO3 Extbase 中集成 soap 客户端? 我已经在网络服务器上安装了 php_soap。我可以使用正常的 http://php.net/manual/de/soapclient.soapclient.php 实现吗?

$client = new SoapClient("my.wsdl", array('login'          => "my_name",
                                       'password'       => "my_passwort"));

也许有一些可用的 extbase 实现?

感谢您的快速提示。为此,我努力寻找好的 extbase 文档。

刚刚发现: Create object in extbase extension from a PHP standard class

How to make a PHP SOAP call using the SoapClient class

我会创建一个 SoapService class 并将其注入到 extbase 控制器中。

SoapService class 可以很容易地注入到控制器中,服务看起来像这样:

<?php

namespace Vendor\Name\Service;


class SoapService
{
    /**
     * @var \SoapClient
     */
    protected $client;

    /**
     * SoapService constructor.
     */
    public function __construct()
    {
        $this->client = new \SoapClient('my.wsdl', ['login' => 'my_name', 'password' => 'my_passwort']);
    }

    /**
     * Fetch data on webservice.
     *
     * @return mixed
     */
    public function fetchWhateverData() {
        $arguments = [];
        return $this->client->__soapCall("getWhateverOnSoapService", $arguments);
    }
}