This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Services and the fly likes Why WSDL2Java says so? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Why WSDL2Java says so?" Watch "Why WSDL2Java says so?" New topic

Why WSDL2Java says so?

Pengju Cheng

Joined: Dec 30, 2009
Posts: 2
I'm trying to use Axis1.4 to generate some proxy class to try my luck but I got this error:

[Loaded java.text.MessageFormat$Field from shared objects file] Element myException is referenced but not defined.
at org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined(Symbol
at org.apache.axis.wsdl.symbolTable.SymbolTable.add(
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
at org.apache.axis.wsdl.gen.Parser$
at Source)

However, the wsdl file I have does contain the following part, isn't it the definition?

<xsd:schema targetNamespace="urn:Genus" xmlns:cmi="urn:Genus">
<!-- fault element -->
<xsd:element name="myException">
<xsd:element name="faultcode" type="xsd:string" minOccurs="1" maxOccurs="1" nillable="false"/>
<xsd:element name="faultstring" type="xsd:string" minOccurs="1" maxOccurs="1" nillable="false"/>
<xsd:element name="detail" type="xsd:string" minOccurs="1" maxOccurs="1" nillable="false"/>

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
It is difficult to tell from your posting, since you have only included a section of the WSDL.
When you define a fault of an operation, you first have to define:
1. The type of the fault message.
This is what you have done in the <wsdl:types> element you have enclosed.
2. The fault message.
This is done in a <wsdl:message> element located AFTER the <wsdl:types> element in your WSDL.

When the above two definitions are in place, you can refer to the MESSAGE from the <wsdl:fault> element of the operation which may respond with the fault.
Do not forget to include the namespace prefix when you refer to the message, if it is not in the default namespace!
Best wishes!
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1167
Similar errors at WSDL2Java Error (Element is referenced but not defined) and Mailing list archives.


William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Why WSDL2Java says so?
Similar Threads
How to access byte array web method
Problem related to XML validation using XSD
Error While Testing Webservice using Web service Explorer in RAD
Cannot create service instance, service 'x' not found in wsdl
Can we support Map/HashMap in the webservice as one of internal parameters?