You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by keith chapman <ke...@gmail.com> on 2006/08/08 08:31:20 UTC
WSDL2Java works for an invalid WSDL
Hi,
I tried using the WSDL2Java tool of axis 2 using the following WSDL's.
Using the following valid WSDL it generates the java classes
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:ns1=" http://org.apache.axis2/xsd" xmlns:xs="
http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/
" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="
http://org.apache.axis2/" targetNamespace=" http://org.apache.axis2/">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns1="
http://org.apache.axis2/xsd" targetNamespace="http://org.apache.axis2/xsd"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="helloRequest">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="param0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="helloResponse">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="return"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="helloRequestMessage">
<wsdl:part name="part1" element="ns1:helloRequest"/>
</wsdl:message>
<wsdl:message name="helloResponseMessage">
<wsdl:part name="part1" element="ns1:helloResponse"/>
</wsdl:message>
<wsdl:portType name="EchoServicePort">
<wsdl:operation name="hello">
<wsdl:input message="tns:helloRequestMessage"/>
<wsdl:output message="tns:helloResponseMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="EchoServiceBinding" type="tns:EchoServicePort">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http "
style="document"/>
<wsdl:operation name="hello">
<soap:operation name="operation" soapAction="hello" style="document"/>
<wsdl:input>
<soap:body use="literal" namespace="http://www.org.apache.axis2"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal" namespace=" http://www.org.apache.axis2"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="EchoService">
<wsdl:port name="EchoServicePortType" binding="tns:EchoServiceBinding">
<soap:address location="http://127.0.0.1:8080/axis2/services/EchoService
"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Then I deleted the message element corresponding to helloRequestMessage.
Still it generates the classes for the following WSDL (with the
helloRequestMessage element deleted)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:ns1="http://org.apache.axis2/xsd" xmlns:xs="
http://www.w3.org/2001/XMLSchema" xmlns:soap="
http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://org.apache.axis2/" targetNamespace="
http://org.apache.axis2/">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ns1="http://org.apache.axis2/xsd
" targetNamespace="http://org.apache.axis2/xsd"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="helloRequest">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="param0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="helloResponse">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="return"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="helloResponseMessage">
<wsdl:part name="part1" element="ns1:helloResponse"/>
</wsdl:message>
<wsdl:portType name="EchoServicePort">
<wsdl:operation name="hello">
<wsdl:input message="tns:helloRequestMessage"/>
<wsdl:output message="tns:helloResponseMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="EchoServiceBinding" type="tns:EchoServicePort">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
<wsdl:operation name="hello">
<soap:operation name="operation" soapAction="hello" style="document"/>
<wsdl:input>
<soap:body use="literal" namespace=" http://www.org.apache.axis2"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal" namespace="http://www.org.apache.axis2 "/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="EchoService">
<wsdl:port name="EchoServicePortType" binding="tns:EchoServiceBinding">
<soap:address location="
http://127.0.0.1:8080/axis2/services/EchoService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Shouldn't this report an error instead of generating the java classes?
Thx,
Keith
Re: WSDL2Java works for an invalid WSDL
Posted by Anne Thomas Manes <at...@gmail.com>.
Please note that the first WSDL was not valid. You MUST NOT specify
the namespace attribute in the <soap:body> elements when using
document style.
Anne
On 8/8/06, Eran Chinthaka <ch...@opensource.lk> wrote:
> Keith,
>
> Can you please file a JIRA with this.
>
> Thanks,
> Chinthaka
>
> keith chapman wrote:
> > Hi,
> >
> > I tried using the WSDL2Java tool of axis 2 using the following WSDL's.
> >
> > Using the following valid WSDL it generates the java classes
> >
> > <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> > <wsdl:definitions xmlns:ns1=" http://org.apache.axis2/xsd"
> > xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="
> > http://schemas.xmlsoap.org/wsdl/soap/
> > <http://schemas.xmlsoap.org/wsdl/soap/>"
> > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="
> > http://org.apache.axis2/" targetNamespace=" http://org.apache.axis2/">
> > <wsdl:types>
> > <xs:schema xmlns:xs=" http://www.w3.org/2001/XMLSchema" xmlns:ns1="
> > http://org.apache.axis2/xsd" targetNamespace="
> > http://org.apache.axis2/xsd" elementFormDefault="qualified"
> > attributeFormDefault="unqualified">
> > <xs:element name="helloRequest">
> > <xs:complexType>
> > <xs:sequence>
> > <xs:element type="xs:string" name="param0"/>
> > </xs:sequence>
> > </xs:complexType>
> > </xs:element>
> > <xs:element name="helloResponse">
> > <xs:complexType>
> > <xs:sequence>
> > <xs:element type="xs:string" name="return"/>
> > </xs:sequence>
> > </xs:complexType>
> > </xs:element>
> > </xs:schema>
> > </wsdl:types>
> > <wsdl:message name="helloRequestMessage">
> > <wsdl:part name="part1" element="ns1:helloRequest"/>
> > </wsdl:message>
> > <wsdl:message name="helloResponseMessage">
> > <wsdl:part name="part1" element="ns1:helloResponse"/>
> > </wsdl:message>
> > <wsdl:portType name="EchoServicePort">
> > <wsdl:operation name="hello">
> > <wsdl:input message="tns:helloRequestMessage"/>
> > <wsdl:output message="tns:helloResponseMessage"/>
> > </wsdl:operation>
> > </wsdl:portType>
> > <wsdl:binding name="EchoServiceBinding" type="tns:EchoServicePort">
> > <soap:binding transport=" http://schemas.xmlsoap.org/soap/http
> > <http://schemas.xmlsoap.org/soap/http>" style="document"/>
> > <wsdl:operation name="hello">
> > <soap:operation name="operation" soapAction="hello" style="document"/>
> > <wsdl:input>
> > <soap:body use="literal" namespace="http://www.org.apache.axis2
> > <http://www.org.apache.axis2/>"/>
> > </wsdl:input>
> > <wsdl:output>
> > <soap:body use="literal" namespace=" http://www.org.apache.axis2
> > <http://www.org.apache.axis2/>"/>
> > </wsdl:output>
> > </wsdl:operation>
> > </wsdl:binding>
> > <wsdl:service name="EchoService">
> > <wsdl:port name="EchoServicePortType" binding="tns:EchoServiceBinding">
> > <soap:address location="
> > http://127.0.0.1:8080/axis2/services/EchoService
> > <http://127.0.0.1:8080/axis2/services/EchoService>"/>
> > </wsdl:port>
> > </wsdl:service>
> > </wsdl:definitions>
> >
> >
> >
> >
> > Then I deleted the message element corresponding to helloRequestMessage.
> > Still it generates the classes for the following WSDL (with the
> > helloRequestMessage element deleted)
> >
> >
> >
> >
> > <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> > <wsdl:definitions xmlns:ns1=" http://org.apache.axis2/xsd" xmlns:xs="
> > http://www.w3.org/2001/XMLSchema" xmlns:soap="
> > http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="
> > http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://org.apache.axis2/"
> > targetNamespace=" http://org.apache.axis2/">
> > <wsdl:types>
> > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns1="
> > http://org.apache.axis2/xsd <http://org.apache.axis2/xsd>"
> > targetNamespace="http://org.apache.axis2/xsd"
> > elementFormDefault="qualified" attributeFormDefault="unqualified">
> > <xs:element name="helloRequest">
> > <xs:complexType>
> > <xs:sequence>
> > <xs:element type="xs:string" name="param0"/>
> > </xs:sequence>
> > </xs:complexType>
> > </xs:element>
> > <xs:element name="helloResponse">
> > <xs:complexType>
> > <xs:sequence>
> > <xs:element type="xs:string" name="return"/>
> > </xs:sequence>
> > </xs:complexType>
> > </xs:element>
> > </xs:schema>
> > </wsdl:types>
> >
> > <wsdl:message name="helloResponseMessage">
> > <wsdl:part name="part1" element="ns1:helloResponse"/>
> > </wsdl:message>
> > <wsdl:portType name="EchoServicePort">
> > <wsdl:operation name="hello">
> > <wsdl:input message="tns:helloRequestMessage"/>
> > <wsdl:output message="tns:helloResponseMessage"/>
> > </wsdl:operation>
> > </wsdl:portType>
> > <wsdl:binding name="EchoServiceBinding" type="tns:EchoServicePort">
> > <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
> > style="document"/>
> > <wsdl:operation name="hello">
> > <soap:operation name="operation" soapAction="hello" style="document"/>
> > <wsdl:input>
> > <soap:body use="literal" namespace=" http://www.org.apache.axis2
> > <http://www.org.apache.axis2/>"/>
> > </wsdl:input>
> > <wsdl:output>
> > <soap:body use="literal" namespace=" http://www.org.apache.axis2
> > <http://www.org.apache.axis2/>"/>
> > </wsdl:output>
> > </wsdl:operation>
> > </wsdl:binding>
> > <wsdl:service name="EchoService">
> > <wsdl:port name="EchoServicePortType" binding="tns:EchoServiceBinding">
> > <soap:address
> > location="http://127.0.0.1:8080/axis2/services/EchoService
> > <http://127.0.0.1:8080/axis2/services/EchoService>"/>
> > </wsdl:port>
> > </wsdl:service>
> > </wsdl:definitions>
> >
> >
> > Shouldn't this report an error instead of generating the java classes?
> >
> > Thx,
> > Keith
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
Re: WSDL2Java works for an invalid WSDL
Posted by Eran Chinthaka <ch...@opensource.lk>.
Keith,
Can you please file a JIRA with this.
Thanks,
Chinthaka
keith chapman wrote:
> Hi,
>
> I tried using the WSDL2Java tool of axis 2 using the following WSDL's.
>
> Using the following valid WSDL it generates the java classes
>
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <wsdl:definitions xmlns:ns1=" http://org.apache.axis2/xsd"
> xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="
> http://schemas.xmlsoap.org/wsdl/soap/
> <http://schemas.xmlsoap.org/wsdl/soap/>"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="
> http://org.apache.axis2/" targetNamespace=" http://org.apache.axis2/">
> <wsdl:types>
> <xs:schema xmlns:xs=" http://www.w3.org/2001/XMLSchema" xmlns:ns1="
> http://org.apache.axis2/xsd" targetNamespace="
> http://org.apache.axis2/xsd" elementFormDefault="qualified"
> attributeFormDefault="unqualified">
> <xs:element name="helloRequest">
> <xs:complexType>
> <xs:sequence>
> <xs:element type="xs:string" name="param0"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="helloResponse">
> <xs:complexType>
> <xs:sequence>
> <xs:element type="xs:string" name="return"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
> </wsdl:types>
> <wsdl:message name="helloRequestMessage">
> <wsdl:part name="part1" element="ns1:helloRequest"/>
> </wsdl:message>
> <wsdl:message name="helloResponseMessage">
> <wsdl:part name="part1" element="ns1:helloResponse"/>
> </wsdl:message>
> <wsdl:portType name="EchoServicePort">
> <wsdl:operation name="hello">
> <wsdl:input message="tns:helloRequestMessage"/>
> <wsdl:output message="tns:helloResponseMessage"/>
> </wsdl:operation>
> </wsdl:portType>
> <wsdl:binding name="EchoServiceBinding" type="tns:EchoServicePort">
> <soap:binding transport=" http://schemas.xmlsoap.org/soap/http
> <http://schemas.xmlsoap.org/soap/http>" style="document"/>
> <wsdl:operation name="hello">
> <soap:operation name="operation" soapAction="hello" style="document"/>
> <wsdl:input>
> <soap:body use="literal" namespace="http://www.org.apache.axis2
> <http://www.org.apache.axis2/>"/>
> </wsdl:input>
> <wsdl:output>
> <soap:body use="literal" namespace=" http://www.org.apache.axis2
> <http://www.org.apache.axis2/>"/>
> </wsdl:output>
> </wsdl:operation>
> </wsdl:binding>
> <wsdl:service name="EchoService">
> <wsdl:port name="EchoServicePortType" binding="tns:EchoServiceBinding">
> <soap:address location="
> http://127.0.0.1:8080/axis2/services/EchoService
> <http://127.0.0.1:8080/axis2/services/EchoService>"/>
> </wsdl:port>
> </wsdl:service>
> </wsdl:definitions>
>
>
>
>
> Then I deleted the message element corresponding to helloRequestMessage.
> Still it generates the classes for the following WSDL (with the
> helloRequestMessage element deleted)
>
>
>
>
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <wsdl:definitions xmlns:ns1=" http://org.apache.axis2/xsd" xmlns:xs="
> http://www.w3.org/2001/XMLSchema" xmlns:soap="
> http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="
> http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://org.apache.axis2/"
> targetNamespace=" http://org.apache.axis2/">
> <wsdl:types>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns1="
> http://org.apache.axis2/xsd <http://org.apache.axis2/xsd>"
> targetNamespace="http://org.apache.axis2/xsd"
> elementFormDefault="qualified" attributeFormDefault="unqualified">
> <xs:element name="helloRequest">
> <xs:complexType>
> <xs:sequence>
> <xs:element type="xs:string" name="param0"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="helloResponse">
> <xs:complexType>
> <xs:sequence>
> <xs:element type="xs:string" name="return"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
> </wsdl:types>
>
> <wsdl:message name="helloResponseMessage">
> <wsdl:part name="part1" element="ns1:helloResponse"/>
> </wsdl:message>
> <wsdl:portType name="EchoServicePort">
> <wsdl:operation name="hello">
> <wsdl:input message="tns:helloRequestMessage"/>
> <wsdl:output message="tns:helloResponseMessage"/>
> </wsdl:operation>
> </wsdl:portType>
> <wsdl:binding name="EchoServiceBinding" type="tns:EchoServicePort">
> <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
> style="document"/>
> <wsdl:operation name="hello">
> <soap:operation name="operation" soapAction="hello" style="document"/>
> <wsdl:input>
> <soap:body use="literal" namespace=" http://www.org.apache.axis2
> <http://www.org.apache.axis2/>"/>
> </wsdl:input>
> <wsdl:output>
> <soap:body use="literal" namespace=" http://www.org.apache.axis2
> <http://www.org.apache.axis2/>"/>
> </wsdl:output>
> </wsdl:operation>
> </wsdl:binding>
> <wsdl:service name="EchoService">
> <wsdl:port name="EchoServicePortType" binding="tns:EchoServiceBinding">
> <soap:address
> location="http://127.0.0.1:8080/axis2/services/EchoService
> <http://127.0.0.1:8080/axis2/services/EchoService>"/>
> </wsdl:port>
> </wsdl:service>
> </wsdl:definitions>
>
>
> Shouldn't this report an error instead of generating the java classes?
>
> Thx,
> Keith