cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ramnarine, Michael" <Michael.Ramnar...@iona.com>
Subject Default input/output names in port types not honored
Date Mon, 12 May 2008 01:47:59 GMT
According to Section 2.4.5 of WSDL 1.1
(http://www.w3.org/TR/wsdl#_names), the name attribute of input and
output elements does not have to be specified; and if not provided will
default to the name of the operation with "Request" or "Response"
appended, for request-response operations.  Unfortunately, CXF does not
like it when the WSDL uses unnamed (defaulted) input and output elements
in the portType operations, but at the same time has explicit name
attributes in the binding, even though the names in the binding match
the default naming specified in section 2.4.5.  The sample defaults.wsdl
at the end of this message is an example of this, and when run through
CXF 2.0.6 or 2.1 wsdlvalidator, errors are reported for the portType
(see the "Sample wsdlvalidator output" below).  

 

Is this a bug in CXF?  

 

P.S.  When the input and output names are made consistent for both
portType and binding, wsdlvalidator is happy.   More interestingly,
reversing the example, and using unnamed (defaulted) input and output
elements in the binding, and using input and output elements with
explicit names which match the default naming in the portType, that
validates OK too.

 

-- Sample wsdlvalidator output --

C:\Ramnarine\dev\ART-10018>C:\apache-cxf-2.1\bin\wsdlvalidator.bat
defaults.wsdl

WSDLValidator Error :

 Summary:  Failures: 2, Warnings: 0

 

 <<< ERROR!

file:/C:/Ramnarine/dev/ART-10018/defaults.wsdl:[44,13]

 Caused by
{http://www.iona.com/artix/defaults}[portType:TestPortType][operation:Te
st][output:TestResponse] not exist.

file:/C:/Ramnarine/dev/ART-10018/defaults.wsdl:[40,13]

 Caused by
{http://www.iona.com/artix/defaults}[portType:TestPortType][operation:Te
st][input:TestRequest] not exist.

 

 

-- Example: defaults.wsdl --

<?xml version="1.0" encoding="UTF-8"?>

<definitions name="defaults.wsdl" 

    targetNamespace="http://www.iona.com/artix/defaults" 

    xmlns="http://schemas.xmlsoap.org/wsdl/" 

    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 

    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" 

    xmlns:tns="http://www.iona.com/artix/defaults" 

    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 

    xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    <types>

        <xsd:schema targetNamespace="http://www.iona.com/artix/defaults"


            xmlns="http://www.iona.com/artix/defaults" 

            xmlns:xsd="http://www.w3.org/2001/XMLSchema">

            <xsd:complexType name="TestType">

                <xsd:sequence>

                    <xsd:element maxOccurs="1" minOccurs="1" name="msg"
type="xsd:string"/>

                    <xsd:element maxOccurs="1" minOccurs="1" name="num"
type="xsd:int"/>

                </xsd:sequence>

            </xsd:complexType>

            <xsd:element name="Test" type="TestType"/>

        </xsd:schema>

    </types>

 

    <message name="TestMessage">

        <part element="tns:Test" name="params"/>

    </message>

 

    <portType name="TestPortType">

        <operation name="Test">

            <input message="tns:TestMessage"/>

            <output message="tns:TestMessage"/>

        </operation>

    </portType>

 

    <binding name="TestPortTypeDefaults" type="tns:TestPortType">

        <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>

        <operation name="Test">

            <soap:operation soapAction="" style="document"/>

 

            <input name="TestRequest">

                <soap:body use="literal"/>

            </input>

 

            <output name="TestResponse">

                <soap:body use="literal"/>

            </output>

 

        </operation>

    </binding>

 

    <service name="TestService">

        <port binding="tns:TestPortTypeDefaults" name="TestPort">

            <soap:address location="http://localhost:9100/TestService"/>

        </port>

    </service>

 

</definitions>

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message