It checks this because in our service model we follow the wsdl2 layout which
only allows one port type in a service. (this also might be a WS-I BP
requirement, I'm not sure though). The way we solved this in XFire was to
allow the WSDLServiceBuilder to build a Collection of services instead of
just one.

- Dan

On 1/31/07, Jim Ma <[EMAIL PROTECTED]> wrote:

Hi all,

WSDLServiceBuilder will fail to build service when given the following
wsdl
contains two ports which reference the different portType :

        <wsdl:service name="SOAPService">
                <wsdl:port binding="prw:Printer_SOAPBinding"
                        name="PrinterSOAPPort">
                        <soap:address
                                location="
http://localhost:9000/PrinterServi
ce/PrinterSOAPPort" />
                        <wswa:UsingAddressing
                                xmlns:wswa="
http://www.w3.org/2005/08/addres
sing/wsdl" />
                </wsdl:port>
                <wsdl:port binding="prw:Job_SOAPBinding"
name="JobSOAPPort">
                        <soap:address
                                location="
http://localhost:9000/PrinterServi
ce/JobSOAPPort" />
                        <wswa:UsingAddressing
                                xmlns:wswa="
http://www.w3.org/2005/08/addres
sing/wsdl" />
                </wsdl:port>
        </wsdl:service>


WSDLServiceBuilder will complain all endpoints must share the same
portType.
I noticed these codes in WSDLServiceBuilder will be used to check if same
portType is referenced by multiple port .

        PortType portType = null;
        for (Port port : cast(serv.getPorts().values(), Port.class)) {
            if (portType == null) {
                portType = port.getBinding().getPortType();
            } else if (port.getBinding().getPortType() != portType) {
                throw new IllegalStateException("All endpoints must share
the same portType");
            }
        }

Why does it need to check this?


Thanks

Jim




--
Dan Diephouse
Envoi Solutions
http://envoisolutions.com | http://netzooid.com/blog

Reply via email to