• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

WSDL2Java Error

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm currently running Apache Tomcat 4.1 with Axis 1.2.
I am not able to generate Client side code using WSDL2Java. I am getting this error:

java.io.IOException: Type {http://util.java}Enumeration is referenced but not defined.
at org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined(SymbolTable.java:665)
at org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:545)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:518)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495)
at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
at java.lang.Thread.run(Thread.java:534)

I'm using complex objects between server and client.

Thanks!
 
Ranch Hand
Posts: 548
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
first step is to validate your wsdl using any wsdl validators. This can show any problems with your wsdl.
 
Lillo Birillo
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you RR Kumaran for the answer

The wsdl was generate by Axis 1.2.
I've tried to validate it with XMLSpy 2005.

" Cannot resolve declaration or definition 'Enumeration' in namespace 'http://util.java' ".

How can I resolve the problem?

Thanks again
 
Ranch Hand
Posts: 539
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You've referenced a 'thing' (of some type, I can't tell from the error message alone) named 'Enumeration' (in XML Namespace 'http://util.java'), but no definition could be found.

It's probably a type or element in an XML Schema, in which case you either need to import the schema correctly, or add the definition if it's missing.

If you can't work it out, post your schema and perhaps someone can help.


-Tim
 
Lillo Birillo
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's the revelant part of the wsdls file.

<?xml version="1.0" encoding="UTF-8"?>
<wsdl efinitions targetNamespace="http://localhost:8080/axis/services/urn:WebServiceTest"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://localhost:8080/axis/services/urn:WebServiceTest"
xmlns:intf="http://localhost:8080/axis/services/urn:WebServiceTest"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns1="http://cont1.li.com"
xmlns:tns2="http://cont2.li.com"
xmlns:tns3="http://util.java"
xmlns:tns4="http://cont3.li.com"
xmlns:tns5="http://lang.java"
xmlns:tns6="http://values.li.com"
xmlns:tns7="http://sql.java"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.2.1
Built on Jun 14, 2005 (09:15:57 EDT)-->
<wsdl:types>
<schema targetNamespace="http://cont2.li.com" xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://localhost:8080/axis/services/urn:WebServiceTest"/>
<import namespace="http://util.java"/>
<import namespace="http://cont1.li.com"/>
<import namespace="http://cont3.li.com"/>
<import namespace="http://lang.java"/>
<import namespace="http://values.li.com"/>
<import namespace="http://sql.java"/>
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="ObjComp1">
<sequence>
<element name="allListNames" nillable="true" type="xsd:anyType"/>
<element name="ObjName" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ObjComp2">
<sequence/>
</complexType>
<complexType name="ObjComp3">
<sequence>
<element maxOccurs="unbounded" name="javaClass" nillable="true" type="xsd:anyType"/>
<element maxOccurs="unbounded" name="type" nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" name="length" type="xsd:int"/>
<element name="size" type="xsd:int"/>
<element maxOccurs="unbounded" name="name" nillable="true" type="xsd:string"/>
<element maxOccurs="unbounded" name="ObjComp2" nillable="true" type="tns2 bjComp2"/>
<element name="fieldEnumeration" nillable="true" type="tns3:Enumeration"/>
<element maxOccurs="unbounded" name="mayBeNull" type=" :boolean"/>
<element maxOccurs="unbounded" name="refData" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ObjComp4">
<sequence>
<element name="enumeration" nillable="true" type="tns3:Enumeration"/>
<element name="refDataTRanslation" type="xsd:boolean"/>
<element name="null" nillable="true" type="xsd:string"/>
<element name="metaData" nillable="true" type="tns2 bjComp3"/>
<element name="attributeCount" type="xsd:int"/>
</sequence>
</complexType>
</schema>
.
.
.
.

</wsdl:types>
.
.
.
.
.


Thanks
 
Lillo Birillo
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now I'm seeing a warning from axis :

- The class java.util.Enumeration is defined in a java or javax package and cannot be converted into
an xml schema type. An xml schema anyType will be used to define this class in the wsdl file.

What does it mean ?

The error after launch wsdl2tojava command remains:

java.io.IOException: Type {http://util.java}Enumeration is referenced but not defined.
at org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined(SymbolTable.java:665)
at org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:545)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:518)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495)
at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
at java.lang.Thread.run(Thread.java:534)
 
Tim West
Ranch Hand
Posts: 539
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, you've imported namespace "http://util.java" and associated it with namespace identifier 'tns3'. You've then referred to a type (presumably) defined by that namespace in lines like these:



However, you aren't providing a schema for namespace "http://util.java", so wsdl2java is complaining. AFAIK, you either need to add an xsi:schemalocation, or (and I find this easier with Axis) rewrite the current schema to not refer to an external one.

If you're not familiar with XML schemas, namespaces and the idea of importing schemas, you really need to learn these concepts before you can fix this problem.

By the way, did you write this schema/WSDL yourself, or generate it with a tool?


-Tim
 
Lillo Birillo
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The wsdl file was generated by Axis.

I have used Axis just in order not to have to learn these concepts.
But now, I think I'll learn them.

Thanks for now...

Ciao.
 
Tim West
Ranch Hand
Posts: 539
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That was the way I learned too - initially I didn't know the messy details of XML Schema, WSDL, SOAP etc, but in the end I had to learn them to be able to identify and resolve bugs and problems.

Good luck!



-Tim
 
This tiny ad is suggesting that maybe she should go play in traffic.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic