Hi,
    I am confused on how to handle attributes in the XML being sent to/from a Web Service. In my WSDL file I have defined an element containing 4 attributes. The Java class generated to represent this element contains 4 variables with setter/getter methods as I expect. However, My WSDL file imports a schema for GML (Geographic Markup Language) and these are defined using abstract elements. Each spatial element has an srsName attribute (which is defined in the abstract parent) but the generated code does not have variables for them or methods to access them. They are part of the TypeDesc section, but there is no way to actually use them.
 
    Am I missing something here or is this an issue in WSDL2Java? I've looked through the Java class hierarchy for anything that might give me access, but there is nothing.
 
    This is the GML AbstractGeometryType element definition:
 
  <complexType name="AbstractGeometryType" abstract="true">
    <annotation>
      <documentation>
        All geometry elements are derived from this abstract supertype;
        a geometry element may have an identifying attribute (gid).
        It may be associated with a spatial reference system.
      </documentation>
    </annotation>
    <complexContent>
      <restriction base="anyType">
        <attribute name="gid" type="ID" use="optional"/>
        <attribute name="srsName" type="anyURI" use="optional"/>
      </restriction>
    </complexContent>
  </complexType>
    This is a concrete element based on this:
 
  <complexType name="PointType">
    <annotation>
      <documentation>
        A Point is defined by a single coordinate tuple.
      </documentation>
    </annotation>
    <complexContent>
      <extension base="gml:AbstractGeometryType">
        <sequence>
          <choice>
            <element ref="gml:coord"/>
            <element ref="gml:coordinates"/>
          </choice>
        </sequence>
      </extension>
    </complexContent>
  </complexType>
    WSDL2Java is generating classes to handle these elements, but I just can't see how to get or set the srsName attribute.
 


--
Steven Smith <[EMAIL PROTECTED]>
Software Developer / Analyst
Telephone 03 6223 1999
Facsimile 03 6223 1988
Web www.geometryit.com
Address 31 Salamanca Square, Battery Point, TAS 7004, Australia
Postal PO Box 844, Sandy Bay, TAS 7006, Australia
 

Reply via email to