[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: How to reference nested complex type

Subject: RE: How to reference nested complex type
From: Michael.Giroux@xxxxxxxx
Date: Thu, 19 May 2005 12:24:08 -0700
wsdl2java referenced but not defined
Chris,

re: why cannot ...

The example I gave is very simple.  The tools being developed are
generating java mappings for COBOL record structures.  Every
group level data item in the cobol record structure becomes
a nested java class (at least that is the intent).

Hence, each cobol group is represented as a complex type.
In COBOL, it is possible to nest groups several
layers deep, but in most cases, two or three levels
is typical.

I discovered by examining the verbose output of WSDL2JAVA
that the correct reference is "tns:outerType>innerType".

Unfortunately, as you observe, WSDL2JAVA does not deal
with the nested types, and managed to emit java that
does not compile because the nested types are not defined.

Ultimately, I had to split the individual complex types out
and define them at the main schema level.

Thanks for looking.

Michael


                                                                           
             "Williamson,                                                  
             Chris"                                                        
             <cwilliamson@khea                                          To 
             a.com>                    "'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'" 
                                       <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>   
             05/19/2005 11:39                                           cc 
             AM                                                            
                                                                   Subject 
                                       RE:  How to reference nested   
             Please respond to         complex type                        
             xsl-list@xxxxxxxx                                             
              lberrytech.com                                               
                                                                           
                                                                           
                                                                           
                                                                           




You're probably posting this message to the wrong forum..but anyways..

I don't think WSDL2Java allows nested complex types; an external scoped
definition would be needed. But let me check on this.

On a side note, why cannot you have this:

<types>
    <xsd:schema targetNamespace="urn:bpel:jiap">

    <xsd:complexType name="subsidyAgreementRequestType">
          <xsd:sequence>
            <xsd:element name="address" type="xsd:string"/>
            <xsd:element name="schoolBusArrival" type="xsd:string"/>
          </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="syncSubsidyAgreementRequestMsg">

         <xsd:sequence>
          <xsd:element type="tns:subsidyAgreementRequestType" name=
"subsidyAgreementRequest"/>
          <xsd:element type="xsd:string" name="mode"/>
        </xsd:sequence>
      </xsd:complexType>

...

</types>

-----Original Message-----
From: Michael.Giroux@xxxxxxxx [mailto:Michael.Giroux@xxxxxxxx]
Sent: Thursday, May 19, 2005 1:28 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  How to reference nested complex type






I'm attempting to write a WSDL that contains a schema with nested complex
types.  The outer type contains an xsd:element reference to the nested
complex type.  When I run WSDL2JAVA I get an error on the reference to the
nested type: Type
{url:bpel:jiap:syncSubsidyAgreementRequestMsg}subsidyAgreementRequestType
is referenced but not defined.

Question: what is the correct syntax for referencing the nested type.  It
has scope local to the outer complexType, so I'm guessing that I need to
form a fully qualified name that references both the containing type and
the
nested one, but so far, I cannot find documentation on this, and I've been
unable to guess at the correct syntax.

Michael Giroux

  <types>
    <xsd:schema targetNamespace="urn:bpel:jiap">

      <xsd:complexType name="syncSubsidyAgreementRequestMsg">

        <xsd:complexType name="subsidyAgreementRequestType">
          <xsd:sequence>
            <xsd:element name="address" type="xsd:string"/>
            <xsd:element name="schoolBusArrival" type="xsd:string"/>
          </xsd:sequence>
        </xsd:complexType>

        <xsd:sequence>
          <xsd:element type="tns:subsidyAgreementRequestType" name=
"subsidyAgreementRequest"/>
          <xsd:element type="xsd:string" name="mode"/>
        </xsd:sequence>
      </xsd:complexType>

...

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.