I have been using Axis 1.0 for quite a while and my WSDL documents contain complexType and simpleType declarations that are named. Not a problem so far. (NOTE: The WSDL is not generated by Axis.) I just started using Visual Studio .NET to build C# equivalents to my Java test programs that act as Web service clients. I ran into some problems with my WSDL documents.

The body of the SOAP response message is strictly hierarchical and it seemed reasonable to declare the complexType for a given element as part of the element definition . Example:

<xsd:element name="services">
<xsd:complexType name="servicesClass">
 <xsd:sequence>
  <xsd:element name="service" minOccurs="0"
               maxOccurs="unbounded">
   <xsd:complexType name="serviceClass">
    <xsd:sequence>
     <xsd:element name="name" type="xsd:string"
                  minOccurs="1" maxOccurs="1" />
     <xsd:element name="description" type="xsd:string"
                  minOccurs="0" maxOccurs="1" />
     <xsd:element name="wsdlURL" type="xsd:string"
                  minOccurs="1" maxOccurs="1" />
    </xsd:sequence>
   </xsd:complexType>
  </xsd:element>
 </xsd:sequence>
</xsd:complexType>
</xsd:element>
--- end Example ------------------------------------

Axis WSDL2Java tool does not have a problem with this and uses the "name" of the complexType as the class name in the generated Java code. All is well,

But, the Microsoft tool complains that each complexType has a name attribute and should not. It then complains that it can't find the corresponding elements when they are used later on in the WSDL document.

Is this a valid error message? If so, why does Axis think this is alright? Is it just being nice?




Reply via email to