0

I'm having trouble generating the client classes using WSDL2Java from Axis1.4. The WSDL contains the header

xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"

The error shown is

java.io.IOException: Element {http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security is referenced but not defined.
    at org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined(SymbolTable.java:670)
    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:680)

Params to WSDL2Java are: -o ./src --package ws.generated -v https://myurl/?WSDL

Am I missing a parameter or some special configuration?

halfer
  • 19,824
  • 17
  • 99
  • 186
sergeiw
  • 1
  • 2

1 Answers1

0

I would have to see the entire WSDL to be certain, but it looks like while you have referenced the namespace in defining the wsse prefix, there is no indication to the (wsdl2java) engine where to find the element/type definitions in the namespace. Try adding the following to your WSDL and executing again:

       <wsdl:import namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" 
       location="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" />

This element should be a peer to <wsdl:types> and <wsdl:message> elements, among others.

This does assume that the wsdl prefix is identified with the namespace for wsdl definitions, a common convention.

dcbyers
  • 864
  • 4
  • 6