Problem with local complex or simple types in Apache Axis

Discussion in 'XML' started by mjcsfo, Aug 14, 2003.

  1. mjcsfo

    mjcsfo Guest

    I can't seem to find a reference nor any helpful threads on this
    topic.

    I've gotten the following error in two circumstances:
    1. A complex type has nested within it another complex type, in the
    "Russian doll" style of schema design, where the nested type is
    local
    and anonymous (not a separate global type).
    2. A complex type has nested within it a simple type which is derived
    through restriction with at least one facet, again nested, local
    and
    anonymous.

    Are these two schema features just not supported? It seems to generate
    the classes and build the service and the service deploys just fine.
    It is only when I attempt to generate a wsdl file automatically does
    it bomb.

    Any help or configuration assistance would be greatly appreciated!

    Thanks,

    Mike


    The error I get (when attempting to generate the wsdl from the Axis
    Servlet's list of services) looks like:

    AXIS error
    Sorry, something seems to have gone wrong... here are the details:

    Fault - makeTypeElement() was told to create a type "{http://
    10.0.0.1/xsd/account/}AccountType>held", with no containing element
    AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
    faultSubcode:
    faultString: makeTypeElement() was told to create a type
    "{http://10.0.0.1/xsd/account/}AccountType>held", with no containing
    element
    faultActor:
    faultNode:
    faultDetail:

    -------------------------------------------------

    Schema subset looks like:
    - accountId, a global type, works fine, nested to any level.
    - name, a local simple type with facets, doesn't work
    - held, a local complex type, doesn't work
    - error above is from this example

    <xsd:complexType name="AccountType">
    <xsd:sequence>
    <!-- global complex or simple type OK -->
    <xsd:element name="accountId" type="a:IdType"/>
    . . .
    <!-- local simple type, derived via restriction with facet BAD -->
    <xsd:element name="name" minOccurs="0">
    <xsd:simpleType>
    <xsd:restriction base="xsd:token">
    <xsd:length value="50"/>
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>
    . . .
    <!-- local complex type BAD -->
    <xsd:element name="held" minOccurs="0">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="reason" type="a:HoldReasonCodeType"/>
    <xsd:element name="timestamp" type="a:DateTimeType"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    . . .
    </xsd:sequence>
    </xsd:complexType>

    -------------------------------------------------

    Subset of Ant build.xml:
    - used to generate AccountType_held class

    <wsdl2java url="wsdl/${wsh-account-service.wsdl}"
    output="../build/work"
    deployscope="session"
    serverside="yes"
    skeletondeploy="yes"
    noimports="no"
    verbose="yes"
    typemappingversion="1.2"
    testcase="no">
    <mapping namespace=http://10.0.0.1/wsdl/account/
    package="uk.co.bbc.wsh.service.account"/>
    <mapping namespace=http://10.0.0.1/xsd/account/
    package="uk.co.bbc.wsh.type.account"/>
    </wsdl2java>

    -------------------------------------------------

    Subset of generated deploy.wsdd defining type:
    - Why is ">" used instead of "_" as in classname? Bug?

    <typeMapping
    xmlns:ns="http://10.0.0.1/xsd/account/"
    qname="ns:AccountType>held"
    type="java:uk.co.bbc.wsh.type.account.AccountType_held"
    serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
    deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
    encodingStyle=""
    />

    Michael Crawford | Senior Architect, Digital Media Solutions
    BBC Technology | 650 California Street | 2nd Floor | San Francisco, CA
    94108
    E: Michael.Crawford (@) bbc.co.uk W: http://www.bbctechnology.com
    E: mjcsfo (@) yahoo
     
    mjcsfo, Aug 14, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mjcsfo
    Replies:
    0
    Views:
    901
    mjcsfo
    Aug 14, 2003
  2. Joey Vendetta
    Replies:
    0
    Views:
    3,508
    Joey Vendetta
    Apr 1, 2004
  3. Replies:
    0
    Views:
    990
  4. Replies:
    2
    Views:
    2,210
  5. Soren Kuula
    Replies:
    2
    Views:
    616
    Henry S. Thompson
    Dec 1, 2005
Loading...

Share This Page