You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Frizz <fr...@googlemail.com> on 2014/05/20 22:48:54 UTC
wsdl2java - Encountered illegal extension attribute 'message'
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>
RE: wsdl2java - Encountered illegal extension attribute 'message'
Posted by XiLai Dai <xl...@talend.com>.
Hi,
For soap binding, the definition should look like:
<wsdl:binding name="localhostBinding" type="tns:MyService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="serviceRequest">
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
You can easily check your WSDL using bin/wsdlvalidator tool before compile it.
Regards.
Xilai Dai
-----Original Message-----
From: Frizz [mailto:frizzthecat@googlemail.com]
Sent: Wednesday, May 21, 2014 4:49 AM
To: users@cxf.apache.org
Subject: wsdl2java - Encountered illegal extension attribute 'message'
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>
Re: wsdl2java - Encountered illegal extension attribute 'message'
Posted by Daniel Kulp <dk...@apache.org>.
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 <fr...@googlemail.com> 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
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com