Hi Dan

The context for this bug was attempting to create a client (using the
ReflectionServiceFactoryBean) and not being able to find any operations
since because of the mismatch in the names between the port-type and the
binding.  Will the fix also address this problem or is it only related
to the validator?


Paul


> -----Original Message-----
> From: Daniel Kulp [mailto:[EMAIL PROTECTED]
> Sent: 12 May 2008 17:43
> To: [email protected]
> Subject: Re: Default input/output names in port types not honored
> 
> 
> Michael,
> 
> This is definitely a bug in the CXF validator.   The xpaths that the
> validator are using don't take the "defaults" into account for this.
> I'm testing a fix for it now.
> 
> Dan
> 
> 
> On May 11, 2008, at 9:47 PM, Ramnarine, Michael wrote:
> 
> > 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>
> >
> >
> >
> 
> ---
> Daniel Kulp
> [EMAIL PROTECTED]
> http://www.dankulp.com/blog
> 
> 

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Reply via email to