You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Darren Clarke <da...@evolvegaming.com> on 2007/07/18 17:52:01 UTC

Problems with Exception and Enum

Hello

I've built an Axis2 service which is consumed by a C# application and this
was working fine until I added a few new methods that require Enum
parameters or which return exceptions, both of which are causing WSDL
errors.


In the case of the Exceptions (e.g. in this case my SystemException extends
java.lang.Exception), the generated WSDL looks like this:

  [snip]
  <xs:schema attributeFormDefault="qualified"
elementFormDefault="qualified"
targetNamespace="http://lgp.evolvegaming.com/xsd">
      <xs:import namespace="http://util.java/xsd"/>
      <xs:element name="SystemException" type="ns3:SystemException"/>
      <xs:complexType name="SystemException">
          <xs:complexContent>
              <xs:extension base="xs:Exception">
                  <xs:sequence/>
              </xs:extension>
          </xs:complexContent>
      </xs:complexType>
    [snip]

and the MS WSDL parser (wsdl.exe) gives me the following schema validation
error:

Schema item 'complexType' named 'SystemException' from namespace
'http://lgp.evolvegaming.com/xsd' is invalid. Undefined complexType
'http://www.w3.org/2001/XMLSchema:Exception' is used as a base for complex
type extension.


The Enum problem is very similar - the generated WSDL looks like this (in
this example for my GameType enum):

    [snip]
    <xs:element name="GameType" type="ns3:GameType"/>
    <xs:complexType name="GameType">
       <xs:complexContent>
          <xs:extension base="xs:Enum">
             <xs:sequence>
                <xs:element name="FOOTBALL" nillable="true"
type="ns3:GameType"/>
             </xs:sequence>
          </xs:extension>
       </xs:complexContent>
    </xs:complexType>

and the parser gives me the following schema validation error:

Schema item 'complexType' named 'GameType' from namespace
'http://lgp.evolvegaming.com/xsd' is invalid. Undefined complexType
'http://www.w3.org/2001/XMLSchema:Enum' is used as a base for complex type
extension.


It seems a similar problem in both cases - the types are trying to extend
from bases <xs:Enum> and <xs:Exception> where the xs namespace is defined at
the very top of the WSDL as:
<wsdl:definitions [snip] xmlns:xs="http://www.w3.org/2001/XMLSchema" [snip]>

but the parser is unable to resolve these two base-types.


Is this a known problem?  I've found a few things on the web regarding Enum
problems in general, but nothing about the problem with Exceptions.  Am I
doing something wrong, or is this a problem for which there's a workaround?

BTW I'm using Axis2 v1.2.  I've tried to distil the important bits from the
WSDL, but can supply the full doc (or the Java interface code) if it helps.

Thanks
Darren



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org