javawsdlwsdl2javaxfire

wsdl java class case sensitivity


In the wsdl I have 2 types, same name, different cases: LoginResponse and LOGINRESPONSE.

If I use xfire to generate the java classes, it only generates one class, LoginResponse, discarding the LOGINRESPONSE.

How do I get around this?

<s:element name="LoginResponse">
    <s:complexType>
      <s:sequence>
        <s:element minOccurs="0" maxOccurs="1" name="LoginResult" type="tns:LOGINRESPONSE" />
      </s:sequence>
    </s:complexType>
  </s:element>

  <s:complexType name="LOGINRESPONSE">
    <s:attribute name="Message" type="s:string" />
    <s:attribute name="Token" type="s:string" />
    <s:attribute name="DataFormat" type="s:string" />
    <s:attribute name="Header" type="s:boolean" use="required" />
    <s:attribute name="Suffix" type="s:boolean" use="required" />
  </s:complexType>

Solution

  • Names declared in WSDL are indeed case sensitive, and it is legal to use names that differ only in their case. However, it has to be a bad idea:

    IMO the best long term fix for your problem is to change the WSDL so that you don't have elements, types, etc whose names differ only by case.