How to generate a multilevel WSDL using Laminas SOAP

I’m trying to figure out how to generate a multilevel XML using Laminas SOAP Autodiscover but I’m unable to do it.

I read the documentation but can not find a way to do it. Here’s the link WSDL AutoDiscovery - laminas-soap - Laminas Docs

Here is the output of what I need:


But I can not find a way to tell the AutoDiscover that a head (Header tag, that will contain a few tags and a child tag called Line). The only WSDL that is generated is by removing the Header and the Line from the function.

Class Soap
 public function test($item1,$item2,$item3,$item4) {

$serverUrl = "http://localhost/api.php";
$options = [
    'uri' => $serverUrl,
$server = new \Laminas\Soap\Server(null, $options);

if (isset($_GET['wsdl'])) {
    $soapAutoDiscover = new \Laminas\Soap\AutoDiscover(new \Laminas\Soap\Wsdl\ComplexTypeStrategy\ArrayOfTypeSequence());
    $soapAutoDiscover->setBindingStyle(array('style' => 'document'));
    $soapAutoDiscover->setOperationBodyStyle(array('use' => 'literal'));
    header("Content-Type: text/xml");
    echo $soapAutoDiscover->generate()->toXml();
} else {
    $soap = new \Laminas\Soap\Server($serverUrl . '?wsdl');
    $soap->setObject(new \Laminas\Soap\Server\DocumentLiteralWrapper(new Soap()));

This will output just an WSDL with the four items:

<xsd:element name="test">
<xsd:element name="item1" type="xsd:anyType"/>
<xsd:element name="item2" type="xsd:anyType"/>
<xsd:element name="item3" type="xsd:anyType"/>
<xsd:element name="item4" type="xsd:anyType"/>

Any help will be appreciated.