Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why WSDL2Java says so?

 
Pengju Cheng
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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]
java.io.IOException: Element myException is referenced but not defined.
at org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined(Symbol
Table.java:670)
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)


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

<wsdl:types>
<xsd:schema targetNamespace="urn:Genus" xmlns:cmi="urn:Genus">
<!-- fault element -->
<xsd:element name="myException">
<xsd:complexType>
<xsd:sequence>
<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"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>

 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
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!
See: http://www.w3.org/TR/wsdl#_request-response
Best wishes!
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Similar errors at WSDL2Java Error (Element is referenced but not defined) and Mailing list archives.

Regards,
Dan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic