Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

[AutoDiscover] Use typehinting on PHP7 #58

Open
@bigfoot90

Description

@bigfoot90

Currently AutoDiscover is not using typehint feature from PHP7.
The main problem is that currently SoapServer is returning empty resposnse and status code 202 Accepted.

My service class:

class MyService
{
    /**
     * @param string $x
     * @return string
     */
    public function test(string $x): string
    {
        return $x;
    }
}

Expected

<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
             xmlns:tns="http://localhost/api/My" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
             xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
             xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" name="MyService"
             targetNamespace="http://localhost/api/My">
    <types>
        <xsd:schema targetNamespace="http://localhost/api/My"/>
    </types>
    <portType name="MyServicePort">
        <operation name="test">
            <documentation>test</documentation>
            <input message="tns:testIn"/>
            <output message="tns:testOut"/>
        </operation>
    </portType>
    <binding name="MyServiceBinding" type="tns:MyServicePort">
        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="test">
            <soap:operation soapAction="http://localhost/api/My#test"/>
            <input>
                <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                           namespace="http://localhost/api/My"/>
            </input>
            <output>
                <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                           namespace="http://localhost/api/My"/>
            </output>
        </operation>
    </binding>
    <service name="MyServiceService">
        <port name="MyServicePort" binding="tns:MyServiceBinding">
            <soap:address location="http://localhost/api/My"/>
        </port>
    </service>
    <message name="testIn">
        <part name="x" type="xsd:string"/>
    </message>
    <message name="testOut">
        <part name="return" type="xsd:string"/>
    </message>
</definitions>

Actual

<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
             xmlns:tns="http://localhost/api/My" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
             xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
             xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" name="MyService"
             targetNamespace="http://localhost/api/My">
    <types>
        <xsd:schema targetNamespace="http://localhost/api/My"/>
    </types>
    <portType name="MyServicePort">
        <operation name="test">
            <documentation>test</documentation>
            <input message="tns:testIn"/>
        </operation>
    </portType>
    <binding name="MyServiceBinding" type="tns:MyServicePort">
        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="test">
            <soap:operation soapAction="http://localhost/api/My#test"/>
            <input>
                <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                           namespace="http://localhost/api/My"/>
            </input>
        </operation>
    </binding>
    <service name="MyServiceService">
        <port name="MyServicePort" binding="tns:MyServiceBinding">
            <soap:address location="http://localhost/api/My"/>
        </port>
    </service>
    <message name="testIn">
        <part name="x" type="xsd:anyType"/>
    </message>
</definitions>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions