axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastian Mittelstädt (JIRA) <>
Subject [jira] Kommentiert: (AXIS2-544) Java2WSDL generates invalid WSDL
Date Mon, 03 Apr 2006 14:33:53 GMT
    [ ] 

Sebastian Mittelstädt commented on AXIS2-544:

I got it running, when you specify no namespaces (no -tn -tp -stn -stp) the generated WSDL
is valid.


When specifying namespaces, the generated WSDL contains errors at the wsdl:message definitions:
The wsdl:part element is buggy.

The "element" attribute gets assigned the wrong namespace, it gets actually assigned the TNS
of the WSDL, but it must be assigned the schema-namespace. In addition, the schema-namespace
has to be be declared at the wsdl:definitions element.

Here is the generated invalid WSDL:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="" xmlns:wsdl=""
xmlns:tns="" xmlns:xs="" xmlns:soap=""
    <xs:schema targetNamespace="com.mycompany.r002.schema" elementFormDefault="unqualified"
attributeFormDefault="unqualified" xmlns:r002schema="com.mycompany.r002.schema">
    <!-- Some definitions omitted -->
      <xs:element name="calculate">
            <xs:element type="r002schema:Input" name="param0"/>
      <xs:element name="calculateResponse">
            <xs:element type="r002schema:Output" name="return"/>
  <wsdl:message name="calculateRequestMessage">
    <wsdl:part element="ns1:calculate" name="part1"/>
  <wsdl:message name="calculateReponseMessage">
    <wsdl:part element="ns1:calculateResponse" name="part1"/>
  <wsdl:portType name="r002PortType">
    <wsdl:operation name="calculate">
      <wsdl:input message="tns:calculateRequestMessage"/>
      <wsdl:output message="tns:calculateReponseMessage"/>
  <wsdl:binding type="tns:r002PortType" name="r002SOAP11Binding">
    <soap:binding style="document" transport=""/>
    <wsdl:operation name="calculate">
      <soap:operation style="document" soapAction="calculate"/>
        <soap:body namespace="com.mycompany.r002" use="literal"/>
        <soap:body namespace="com.mycompany.r002" use="literal"/>
  <wsdl:service name="r002">
    <wsdl:port binding="tns:r002SOAP11Binding" name="r002port">
      <soap:address location="http://localhost:8080/axis2/services/r002"/>

Have a look at this
   <wsdl:message name="calculateRequestMessage">
      <wsdl:part element="ns1:calculate" name="part1"/>

Actually, ns1 is xmlns:ns1="http://org.apache.axis2/xsd".

But for the WSDL to be valid, the namespace has to be r002schema,  the schema-namespace.

Correct would be
   <wsdl:message name="calculateRequestMessage">
    <wsdl:part element="r002schema:calculate" name="part1"/>

The namespace r002schema is xmlns:r002schema="com.mycompany.r002.schema", but it is actually
only defined at the schema.

For the WSDL to be valid, it has to be declared at the wsdl:definitions element.

With those changes, the WSDL is valid.


> Java2WSDL generates invalid WSDL
> --------------------------------
>          Key: AXIS2-544
>          URL:
>      Project: Apache Axis 2.0 (Axis2)
>         Type: Bug

>   Components: Tools
>     Versions: 0.95
>     Reporter: Sebastian Mittelstädt

> In 0.95, the Java2WSDL class generates invalid WSDL. 
> The following WSDL was generated with Java2WSDL:
> java2wsdl -cn com.mycompany.r002.R002 -cp bin -tn http://com.mycompany.r002 -stn http://com.mycompany.r002.schema
-stp r002schema -sn r002 -of r002.wsdl
> This generated the following WSDL:
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions targetNamespace="http://com.mycompany.r002" xmlns:xs=""
xmlns:soap="" xmlns:wsdl=""
>   <wsdl:types>
>     <xs:schema targetNamespace="http://com.mycompany.r002.schema" elementFormDefault="unqualified"
attributeFormDefault="unqualified" xmlns:r002schema="http://com.mycompany.r002.schema">
>       <!-- Type definitions (omitted) -->
>     </xs:schema>
>   </wsdl:types>
>   <wsdl:message name="calculateResponseMessage">
>     <wsdl:part name="part1" element="r002schema:calculateResponse"/>
>   </wsdl:message>
>   <wsdl:message name="calculateRequestMessage">
>     <wsdl:part name="part1" element="r002schema:calculateRequest"/>
>   </wsdl:message>
>   <wsdl:portType name="r002PortType">
>     <wsdl:operation name="calculate">
>       <wsdl:input message="tns:calculateRequestMessage"/>
>       <wsdl:output message="tns:calculateResponseMessage"/>
>     </wsdl:operation>
>   </wsdl:portType>
>   <wsdl:binding name="r002Binding" type="tns:r002PortType">
>     <soap:binding transport="" style="document"/>
>     <wsdl:operation name="calculate">
>       <soap:operation soapAction="calculate" style="document"/>
>       <wsdl:input>
>         <soap:body use="literal" namespace="http://com.mycompany.r002"/>
>       </wsdl:input>
>       <wsdl:output>
>         <soap:body use="literal" namespace="http://com.mycompany.r002"/>
>       </wsdl:output>
>     </wsdl:operation>
>   </wsdl:binding>
>   <wsdl:service name="r002">
>     <wsdl:port name="r002Port" binding="axis2:r002Binding">
>       <soap:address location=""/>
>     </wsdl:port>
>   </wsdl:service>
> </wsdl:definitions>
> This WSDL is invalid due to the following errors:
> - The value 'axis2:r002Binding' of attribute 'binding' on element 'wsdl:port' is not
valid with respect to its type, 'QName'.
> - The value 'r002schema:calculateRequest' of attribute 'element' on element 'wsdl:part'
is not valid with respect to its type, 'QName'.
> - The value 'r002schema:calculateResponse' of attribute 'element' on element 'wsdl:part'
is not valid with respect to its type, 'QName'.	
> - Cannot resolve 'axis2:r002Binding' as a QName: the prefix 'axis2' is not declared.
> - Cannot resolve 'r002schema:calculateRequest' as a QName: the prefix 'r002schema' is
not declared.
> - Cannot resolve 'r002schema:calculateResponse' as a QName: the prefix 'r002schema' is
not declared.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message