Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoDiscover] Use typehinting on PHP7 #3

Closed
weierophinney opened this issue Dec 31, 2019 · 2 comments
Closed

[AutoDiscover] Use typehinting on PHP7 #3

weierophinney opened this issue Dec 31, 2019 · 2 comments

Comments

@weierophinney
Copy link
Member

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>

Originally posted by @bigfoot90 at zendframework/zend-soap#58

@webmaster777
Copy link

Isn't this rather an issue in the Reflection implementation in the laminas-server package?

@weierophinney
Copy link
Member Author

This package is considered feature-complete, and is now in security-only maintenance mode, following a decision by the Technical Steering Committee.
If you have a security issue, please follow our security reporting guidelines.
If you wish to take on the role of maintainer, please nominate yourself

If you need an actively developed SOAP client, we recommend phpro/soap-client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants