According to the WSDL spec: http://www.w3.org/TR/wsdl#_bindings
The wsdl:input/output elements in the binding can have a name attribute, but the message attribute is not allowed there. Thus, the wsdl is invalid. Dan On May 20, 2014, at 4:48 PM, Frizz <[email protected]> wrote: > Hi there, > > I am using CXF 2.7.7. I have a WSDL that is correct and valid (imho). > > But when running wsdl2java it doesn't seem to like the 'message' attribute > in my binding/operation definition. > > Here is the error message from wsdl2java: > > WSDLToJava Error: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to > create wsdl definition from : file:/C:/ws/example/MyService.wsdl > Caused by : WSDLException (at > /wsdl:definitions/wsdl:binding/wsdl:operation/wsdl:input): > faultCode=INVALID_WSDL: Encountered illegal extension attribute 'message'. > Extension attributes must be in a namespace other than WSDL's. > > > Here is the WSDL file: > > <?xml version="1.0" encoding="UTF-8"?> > <wsdl:definitions > targetNamespace="http://example.com/MyService.wsdl" > xmlns="http://schemas.xmlsoap.org/wsdl/" > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" > xmlns:tns="http://example.com/MyService.wsdl" > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> > > <wsdl:types> > <xsd:schema targetNamespace="http://example.com/MyService.wsdl" > xmlns="http://www.w3.org/2001/XMLSchema"> > <xsd:element name="serviceRequest"> > <xsd:complexType> > <xsd:sequence> > <xsd:element maxOccurs="1" minOccurs="0" > name="serviceDescription" type="xsd:string"></xsd:element> > </xsd:sequence> > </xsd:complexType> > </xsd:element> > <xsd:element name="serviceResponse"> > <xsd:complexType> > <xsd:sequence> > <xsd:element maxOccurs="1" minOccurs="1" > name="result" type="xsd:int"/> > </xsd:sequence> > </xsd:complexType> > </xsd:element> > </xsd:schema> > </wsdl:types> > > <wsdl:message name="serviceRequestRequest"> > <wsdl:part element="tns:serviceRequest" > name="parameters"></wsdl:part> > </wsdl:message> > <wsdl:message name="serviceResponse"> > <wsdl:part element="tns:serviceResponse" > name="parameters"></wsdl:part> > </wsdl:message> > > <wsdl:portType name="MyService" > > <wsdl:operation name="serviceRequest"> > <wsdl:input message="tns:serviceRequestRequest"></wsdl:input> > <wsdl:output message="tns:serviceResponse"></wsdl:output> > </wsdl:operation> > </wsdl:portType> > > <wsdl:binding name="localhostBinding" type="tns:MyService"> > <soap:binding style="document" transport=" > http://schemas.xmlsoap.org/soap/http"/> > <wsdl:operation name="serviceRequest"> > <wsdl:input message="tns:serviceRequestRequest"></wsdl:input> > <wsdl:output message="tns:serviceResponse"></wsdl:output> > </wsdl:operation> > </wsdl:binding> > > <wsdl:service name="MyServiceProvider"> > <wsdl:port binding="tns:localhostBinding" name="localhost"> > <soap:address location=" > http://localhost:8080/services/MyServiceProvider/"/> > </wsdl:port> > </wsdl:service> > > </wsdl:definitions> -- Daniel Kulp [email protected] - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com
