Only one port is generated if ports and bindings aren't ordered (maybe better error reporting?) #123

Closed
hedefalk opened this Issue Nov 28, 2011 · 1 comment

Comments

Projects
None yet
2 participants
@hedefalk

The following wsdl only generates one port in code

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.hedefalk.se/test/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://www.hedefalk.se/test/">
    <wsdl:message name="MessageIn">
        <wsdl:part name="in" type="xsd:string" />
    </wsdl:message>
    <wsdl:message name="MessageOut">
        <wsdl:part name="out" type="xsd:string" />
    </wsdl:message>
    <wsdl:portType name="PortType1">
        <wsdl:operation name="Operation1">
            <wsdl:input message="tns:MessageIn" />
            <wsdl:output message="tns:MessageOut" />
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="Binding1" type="tns:PortType1">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
        <wsdl:operation name="Operation1">
            <soap:operation soapAction="http://hedefalk.se/test" style="document" />
            <wsdl:input>
                <soap:body use="literal" />
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal" />
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:portType name="PortType2">
        <wsdl:operation name="Operation2">
            <wsdl:input message="tns:MessageIn" />
            <wsdl:output message="tns:MessageOut" />
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="Binding2" type="tns:PortType2">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
        <wsdl:operation name="Operation2">
            <soap:operation soapAction="http://hedefalk.se/test" style="document" />
            <wsdl:input>
                <soap:body use="literal" />
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal" />
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="service">
        <wsdl:port binding="tns:Binding1" name="Port1"></wsdl:port>
        <wsdl:port binding="tns:Binding2" name="Port2"></wsdl:port>
    </wsdl:service>
</wsdl:definitions>

while the following generates both:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.hedefalk.se/test/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://www.hedefalk.se/test/">
    <wsdl:message name="MessageIn">
        <wsdl:part name="in" type="xsd:string" />
    </wsdl:message>
    <wsdl:message name="MessageOut">
        <wsdl:part name="out" type="xsd:string" />
    </wsdl:message>
    <wsdl:portType name="PortType1">
        <wsdl:operation name="Operation1">
            <wsdl:input message="tns:MessageIn" />
            <wsdl:output message="tns:MessageOut" />
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:portType name="PortType2">
        <wsdl:operation name="Operation2">
            <wsdl:input message="tns:MessageIn" />
            <wsdl:output message="tns:MessageOut" />
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="Binding1" type="tns:PortType1">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
        <wsdl:operation name="Operation1">
            <soap:operation soapAction="http://hedefalk.se/test" style="document" />
            <wsdl:input>
                <soap:body use="literal" />
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal" />
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="Binding2" type="tns:PortType2">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
        <wsdl:operation name="Operation2">
            <soap:operation soapAction="http://hedefalk.se/test" style="document" />
            <wsdl:input>
                <soap:body use="literal" />
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal" />
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="service">
        <wsdl:port binding="tns:Binding1" name="Port1"></wsdl:port>
        <wsdl:port binding="tns:Binding2" name="Port2"></wsdl:port>
    </wsdl:service>
</wsdl:definitions>

I guess the first isn't really a valid wsdl (http://www.w3.org/TR/wsdl#_document-s), but for a guy with rusty wsdl skillz it took a while to hunt down. Maybe there could be some wsdl validation first that would halt if any assumptions are violated?

@eed3si9n

This comment has been minimized.

Show comment Hide comment
@eed3si9n

eed3si9n Jan 10, 2012

Owner

This is now being addressed, but I am closing this as a duplicate of #87 and #124.

Owner

eed3si9n commented Jan 10, 2012

This is now being addressed, but I am closing this as a duplicate of #87 and #124.

@eed3si9n eed3si9n closed this Jan 10, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment