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

[AutoDiscover] Use typehinting on PHP7 #58

Open
bigfoot90 opened this issue Dec 29, 2018 · 1 comment
Open

[AutoDiscover] Use typehinting on PHP7 #58

bigfoot90 opened this issue Dec 29, 2018 · 1 comment

Comments

@bigfoot90
Copy link

bigfoot90 commented Dec 29, 2018

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>
@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-soap; a new issue has been opened at laminas/laminas-soap#3.

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

No branches or pull requests

2 participants