axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean O'Leary" <razorho...@gmail.com>
Subject wsdl2java issue when parsing wsdl that uses empty namespaces
Date Thu, 15 Oct 2009 18:00:06 GMT
Hi everyone,
Using: Axis version 1.4 (4/22/2006)

I'm using wsdl2java to compile a wsdl for a service that one of my customers
has provided. Everything is fine except for they have one type that they
have declared in a separate schema in the wsdl with no targetNamespace and
then they refer to that type from another schema without putting anything in
for the namespace prefix. This seems to be "valid" wsdl (using no namespace)
but wsdl2java throws the following exception:

java.io.IOException: Type PhoneType is referenced but not defined.
        at
org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined(Symbol
Table.java:665)
        at
org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:545
)
        at
org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
a:518)
        at
org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
a:495)
        at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
        at java.lang.Thread.run(Unknown Source)


Here's the offending WSDL snippet:

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="
http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="
http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="
http://services.xyzcompany.com" xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="
http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="
http://services.xyzcompany.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/
">

  <wsdl:types>

    <s:schema elementFormDefault="qualified" targetNamespace="
http://services.xyzcompany.com">
      <s:import />


      ....


      <s:complexType name="Phone">
      <s:sequence>
 <s:element minOccurs="0" maxOccurs="1" name="PhoneDescription"
type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="PhoneNumber" type="s:string" />
 <s:element minOccurs="0" maxOccurs="1" name="Extension" type="s:string" />
      </s:sequence>
       <s:attribute name="PhoneType" type="PhoneType" use="required" />
      </s:complexType>

      ....


    </s:schema>

    <s:schema elementFormDefault="qualified">
      <s:simpleType name="PhoneType">
        <s:restriction base="s:string">
          <s:enumeration value="office" />
          <s:enumeration value="cell" />
          <s:enumeration value="fax" />
          <s:enumeration value="personal" />
          <s:enumeration value="home" />
          <s:enumeration value="other" />
        </s:restriction>
      </s:simpleType>
    </s:schema>

  </wsdl:types>

</wsdl:definitions>


If I add  targetNamespace="http://services.xyzcompany.com"  to the 2nd
schema and then prefix the type="PhoneType" so it is type="tns:PhoneType",
wsdl2java is able to compile the wsdl. Then the problem is of course as soon
as I use the generated code to connect to the service it errors out as axis
complains about the same issue with the service's wsdl.

Any help you can provide is very much appreciated.

Thanks!
Sean

Mime
View raw message