[prev in list] [next in list] [prev in thread] [next in thread]
List: axis-user
Subject: wsdl2java error using Xmlbeans binding
From: "Hall, Alex A." <alex.hall () ngc ! com>
Date: 2007-04-30 23:11:50
Message-ID: 38149E6F095CF440BD5C7C888C722DAD044B05EE () XMBMD105 ! northgrum ! com
[Download RAW message or body]
Axis Users,
I'm having trouble attempting to generate server-side skeletons for a
WSDL which imports a fairly complex schema. I extracted the troublesome
part and am including it here. Using Axis2 version 1.2 and running the
following command on Test.wsdl (contents listed at [1] below):
% wsdl2java -o C:\wsdl\gensrc -d xmlbeans -ss -uri C:\wsdl\Test.wsdl
I get the chained error shown at [2] below.
The exception seems to indicate an invalid schema, but the schema
validates fine using the W3C validator and the WSDL compiles using
Xmlbeans 2.2.0 from the command-line. It's complaining about the
"xs:minInclusive" element in the Angle type, but interestingly, when I
comment out the "xs:attribute" element in Angle, everything works. Am I
missing something here? Perhaps there is a problem in the Axis-Xmlbeans
interface? Any help or suggestions for a workaround would be greatly
appreciated.
Regards,
Alex Hall
alex.hall@ngc.com
[1] Contents of Test.wsdl:
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://example.com/TestDataManagerService"
targetNamespace="http://example.com/TestDataManagerService"
name="TestDataManagerService">
<types>
<xs:schema
targetNamespace="http://example.com/TestDataManagerService">
<xs:element name="getDataRequest" type="tns:GetDataRequestType"/>
<xs:element name="getDataResponse"
type="tns:GetDataResponseType"/>
<xs:complexType name="GetDataRequestType">
<xs:sequence>
<xs:element name="id" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="GetDataResponseType">
<xs:sequence>
<xs:element name="resultValue" type="tns:Angle"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Measure" abstract="true">
<xs:simpleContent>
<xs:extension base="xs:decimal">
<xs:attribute name="uom" type="xs:string" use="optional"/>
<xs:attribute name="factor" type="xs:decimal" use="optional"
default="1"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="Angle">
<xs:simpleContent>
<xs:restriction base="tns:Measure">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="360"/>
<xs:attribute name="uom" use="optional" default="deg">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="deg"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:restriction>
</xs:simpleContent>
</xs:complexType>
</xs:schema>
</types>
<message name="GetDataRequest">
<part name="getDataRequest" element="tns:getDataRequest"/>
</message>
<message name="GetDataResponse">
<part name="getDataResponse" element="tns:getDataResponse"/>
</message>
<portType name="TestDataManagerServicePortType">
<operation name="getData">
<input message="tns:GetDataRequest"/>
<output message="tns:GetDataResponse"/>
</operation>
</portType>
<binding name="TestDataManagerServiceSoapBinding"
type="tns:TestDataManagerServicePortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="getData">
<soap:operation soapAction="getData"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="TestDataManagerService">
<port name="TestDataManagerServiceSoapEndpoint"
binding="tns:TestDataManagerServiceSoapBinding">
<soap:address
location="http://example.com/TestDataManagerService"/>
</port>
</service>
</definitions>
[2] wsdl2java exception:
[chained exceptions removed]
Caused by: org.apache.xmlbeans.XmlException: error:
cvc-complex-type.2.4a: Expected elements
'attribute@http://www.w3.org/2001/XMLSchema
attributeGroup@http://www.w3.org/2001/XMLSchema
anyAttribute@http://www.w3.org/2001/XMLSchema' instead of
'minInclusive@http://www.w3.org/2001/XMLSchema' here in element
restriction@http://www.w3.org/2001/XMLSchema
at
org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(SchemaT
ypeSystemCompiler.java:225)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.xmlbeans.XmlBeans.compileXmlBeans(XmlBeans.java:667)
at
org.apache.axis2.xmlbeans.CodeGenerationUtility.processSchemas(CodeGener
ationUtility.java:174)
... 8 more
[Attachment #3 (text/html)]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7651.59">
<TITLE>wsdl2java error using Xmlbeans binding</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">Axis Users,</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">I'm having trouble attempting to generate server-side \
skeletons for a WSDL which imports a fairly complex schema. I extracted the \
troublesome part and am including it here. Using Axis2 version 1.2 and running \
the following command on Test.wsdl (contents listed at [1] below):</FONT></P>
<P><FONT SIZE=2 FACE="Arial">% wsdl2java -o C:\wsdl\gensrc -d xmlbeans -ss -uri \
C:\wsdl\Test.wsdl</FONT> </P>
<P><FONT SIZE=2 FACE="Arial">I get the chained error shown at [2] below.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">The exception seems to indicate an invalid schema, but \
the schema validates fine using the W3C validator and the WSDL compiles using \
Xmlbeans 2.2.0 from the command-line. It's complaining about the \
"xs:minInclusive" element in the Angle type, but interestingly, when I \
comment out the "xs:attribute" element in Angle, everything works. Am \
I missing something here? Perhaps there is a problem in the Axis-Xmlbeans \
interface? Any help or suggestions for a workaround would be greatly \
appreciated.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Regards,</FONT>
<BR><B><FONT SIZE=2 FACE="Tahoma">Alex Hall</FONT></B>
<BR><FONT SIZE=2 FACE="Tahoma">alex.hall@ngc.com</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">[1] Contents of Test.wsdl:</FONT>
<BR><FONT SIZE=2 FACE="Arial"><?xml version="1.0" \
encoding="UTF-8"?></FONT>
<BR><FONT SIZE=2 FACE="Arial"><definitions xmlns="<A \
HREF="http://schemas.xmlsoap.org/wsdl/">http://schemas.xmlsoap.org/wsdl/</A>"</FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
xmlns:soap="<A HREF="http://schemas.xmlsoap.org/wsdl/soap/">http://schemas.xmlsoap.org/wsdl/soap/</A>"</FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
xmlns:xs="<A HREF="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</A>"</FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
xmlns:tns="<A HREF="http://example.com/TestDataManagerService">http://example.com/TestDataManagerService</A>"</FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
targetNamespace="<A \
HREF="http://example.com/TestDataManagerService">http://example.com/TestDataManagerService</A>"</FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
name="TestDataManagerService"></FONT>
<BR><FONT SIZE=2 FACE="Arial"> <types></FONT>
<BR><FONT SIZE=2 FACE="Arial"> <xs:schema \
targetNamespace="<A \
HREF="http://example.com/TestDataManagerService">http://example.com/TestDataManagerService</A>"></FONT>
<BR><FONT SIZE=2 FACE="Arial"> <xs:element \
name="getDataRequest" type="tns:GetDataRequestType"/></FONT>
<BR><FONT SIZE=2 FACE="Arial"> <xs:element \
name="getDataResponse" type="tns:GetDataResponseType"/></FONT>
<BR><FONT SIZE=2 FACE="Arial"> <xs:complexType \
name="GetDataRequestType"></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
<xs:sequence></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
<xs:element name="id" type="xs:string"/></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
</xs:sequence></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
</xs:complexType></FONT>
<BR><FONT SIZE=2 FACE="Arial"> <xs:complexType \
name="GetDataResponseType"></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
<xs:sequence></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
<xs:element name="resultValue" type="tns:Angle"/></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
</xs:sequence></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
</xs:complexType></FONT>
<BR><FONT SIZE=2 FACE="Arial"> <xs:complexType \
name="Measure" abstract="true"></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
<xs:simpleContent></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
<xs:extension base="xs:decimal"></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
<xs:attribute name="uom" type="xs:string" \
use="optional"/></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
<xs:attribute name="factor" type="xs:decimal" \
use="optional" default="1"/></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
</xs:extension></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
</xs:simpleContent></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
</xs:complexType></FONT>
<BR><FONT SIZE=2 FACE="Arial"> <xs:complexType \
name="Angle"></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
<xs:simpleContent></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
<xs:restriction base="tns:Measure"></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
<xs:minInclusive value="0"/></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
<xs:maxInclusive value="360"/></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
<xs:attribute name="uom" use="optional" \
default="deg"></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
<xs:simpleType></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
<xs:restriction base="xs:token"></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
<xs:enumeration value="deg"/></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
</xs:restriction></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
</xs:simpleType></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
</xs:attribute></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
</xs:restriction></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
</xs:simpleContent></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
</xs:complexType></FONT>
<BR><FONT SIZE=2 FACE="Arial"> </xs:schema></FONT>
<BR><FONT SIZE=2 FACE="Arial"> </types></FONT>
<BR><FONT SIZE=2 FACE="Arial"> <message \
name="GetDataRequest"></FONT>
<BR><FONT SIZE=2 FACE="Arial"> <part \
name="getDataRequest" element="tns:getDataRequest"/></FONT>
<BR><FONT SIZE=2 FACE="Arial"> </message></FONT>
<BR><FONT SIZE=2 FACE="Arial"> <message \
name="GetDataResponse"></FONT>
<BR><FONT SIZE=2 FACE="Arial"> <part \
name="getDataResponse" element="tns:getDataResponse"/></FONT>
<BR><FONT SIZE=2 FACE="Arial"> </message></FONT>
<BR><FONT SIZE=2 FACE="Arial"> <portType \
name="TestDataManagerServicePortType"></FONT>
<BR><FONT SIZE=2 FACE="Arial"> <operation \
name="getData"></FONT>
<BR><FONT SIZE=2 FACE="Arial"> <input \
message="tns:GetDataRequest"/></FONT>
<BR><FONT SIZE=2 FACE="Arial"> <output \
message="tns:GetDataResponse"/></FONT>
<BR><FONT SIZE=2 FACE="Arial"> </operation></FONT>
<BR><FONT SIZE=2 FACE="Arial"> </portType></FONT>
<BR><FONT SIZE=2 FACE="Arial"> <binding \
name="TestDataManagerServiceSoapBinding" \
type="tns:TestDataManagerServicePortType"></FONT>
<BR><FONT SIZE=2 FACE="Arial"> <soap:binding \
style="document" transport="<A \
HREF="http://schemas.xmlsoap.org/soap/http">http://schemas.xmlsoap.org/soap/http</A>"/></FONT>
<BR><FONT SIZE=2 FACE="Arial"> <operation \
name="getData"></FONT>
<BR><FONT SIZE=2 FACE="Arial"> <soap:operation \
soapAction="getData"/></FONT>
<BR><FONT SIZE=2 FACE="Arial"> <input></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
<soap:body use="literal"/></FONT>
<BR><FONT SIZE=2 FACE="Arial"> </input></FONT>
<BR><FONT SIZE=2 FACE="Arial"> <output></FONT>
<BR><FONT SIZE=2 FACE="Arial"> \
<soap:body use="literal"/></FONT>
<BR><FONT SIZE=2 FACE="Arial"> </output></FONT>
<BR><FONT SIZE=2 FACE="Arial"> </operation></FONT>
<BR><FONT SIZE=2 FACE="Arial"> </binding></FONT>
<BR><FONT SIZE=2 FACE="Arial"> <service \
name="TestDataManagerService"></FONT>
<BR><FONT SIZE=2 FACE="Arial"> <port \
name="TestDataManagerServiceSoapEndpoint" \
binding="tns:TestDataManagerServiceSoapBinding"></FONT>
<BR><FONT SIZE=2 FACE="Arial"> <soap:address \
location="<A HREF="http://example.com/TestDataManagerService">http://example.com/TestDataManagerService</A>"/></FONT>
<BR><FONT SIZE=2 FACE="Arial"> </port></FONT>
<BR><FONT SIZE=2 FACE="Arial"> </service></FONT>
<BR><FONT SIZE=2 FACE="Arial"></definitions></FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">[2] wsdl2java exception:</FONT>
<BR><FONT SIZE=2 FACE="Arial">[chained exceptions removed]</FONT>
<BR><FONT SIZE=2 FACE="Arial">Caused by: org.apache.xmlbeans.XmlException: error: \
cvc-complex-type.2.4a: Expected elements 'attribute@<A \
HREF="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</A> \
attributeGroup@<A HREF="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</A> \
anyAttribute@<A HREF="http://www.w3.org/2001/XMLSchema'">http://www.w3.org/2001/XMLSchema'</A> \
instead of 'minInclusive@<A \
HREF="http://www.w3.org/2001/XMLSchema'">http://www.w3.org/2001/XMLSchema'</A> here \
in element restriction@<A \
HREF="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</A></FONT></P>
<P><FONT SIZE=2 FACE="Arial"> at \
org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(SchemaTypeSystemCompiler.java:225)</FONT>
<BR><FONT SIZE=2 FACE="Arial"> at \
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</FONT>
<BR><FONT SIZE=2 FACE="Arial"> at \
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</FONT>
<BR><FONT SIZE=2 FACE="Arial"> at \
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</FONT>
<BR><FONT SIZE=2 FACE="Arial"> at \
java.lang.reflect.Method.invoke(Method.java:585)</FONT>
<BR><FONT SIZE=2 FACE="Arial"> at \
org.apache.xmlbeans.XmlBeans.compileXmlBeans(XmlBeans.java:667)</FONT>
<BR><FONT SIZE=2 FACE="Arial"> at \
org.apache.axis2.xmlbeans.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:174)</FONT>
<BR><FONT SIZE=2 FACE="Arial"> ... 8 \
more</FONT> </P>
</BODY>
</HTML>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic