• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Axis WSDL2Java's Error: reference but not defined

 
Ranch Hand
Posts: 548
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have below wsdl which uses 2 xsd files using schema import element. When I run WSDL2Java program of AXIS 1.2 RC2, I am getting below error. I dont understand this error even though this WSDL has been "validated ok" by wsdl validators. Please suggest ....





Thanks & Regards,
 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try adding the following "import" clauses to each <schema> element in your wsdl and then run wsdl2java?
 
Rr Kumaran
Ranch Hand
Posts: 548
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Amit,

Thank you for the response. I have already added the import elements in each of my schema sections of my wsdl. Can you please be more specific ... ?
 
Ranch Hand
Posts: 1067
2
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

One of the confusing things about all this is that namespace names are URLs; it's
easy to assume that since they're Web addresses, they must be the address of
something. They're not; these are URLs, but the namespace draft doesn't care what
(if anything) they point at.



This example I found has the complete path to the xsd, you only have the name. The
namespace attribute is the name of your defined name space, the schemaLocation is
where to find your xsd.


And in a totally unrelated question, why are you defining the same namespace
twice?

[ March 31, 2005: Message edited by: William Barnes ]
 
Rr Kumaran
Ranch Hand
Posts: 548
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi William Barnes,

Both the xsd's are there in same location of my hard drive and the wsdl, 2 xsd's are validated ok" by xmlspy validator. I think there is no problem regarding schemaLoction and namespace attributes.

Yeah, it is redundant that I have declared 2 namespace but that is not also a problem either.
 
William Barnes
Ranch Hand
Posts: 1067
2
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would suggest using the absolute path to the xsd file. It is a easy
thing to try. Just because xmlspy can find the files doesn't mean
everyone else can find them.
I guess you could put everything into one file, that would get rid of
the problem. Not pretty, but what the hay.
Other than that I don't have any useful suggestions.
 
Rr Kumaran
Ranch Hand
Posts: 548
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Even if I put the 2 xsd's in the wsdl itself, I am getting the same error
 
Amit G Piplani
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Kindly find modified dcplanlistws.xsd

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns2="http://ws.as.com/schemas/dcplanlistws" xmlns:ns1="http://ws.as.com/schemas/dcquickvaluews" targetNamespace="http://ws.as.com/schemas/dcquickvaluews" elementFormDefault="qualified">
<import namespace="http://ws.as.com/schemas/dcplanlistws" schemaLocation="dcplanlistws.xsd"/>
<complexType name="REQUESTDATA">
<complexContent>
<extension base="tns2:bs-request-bean">
<sequence>
<element name="requestEntries" type="tns2 LAN" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType name="TCINFO">
<complexContent>
<extension base="tns2:bs-data-bean">
<sequence>
<element name="ERRORS" type="xsd:boolean"/>
<element name="NUMPLANS" type="xsd:boolean"/>
<element name="PLAN" type="tns2 LAN" minOccurs="0" maxOccurs="unbounded"/>
<element name="PLANVALUES" type="tns2:TCPlanValues" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</extension>
</complexContent>
</complexType>
</schema>

and dcquickvaluews.xsd to make WSDL2Java working :
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns2="http://ws.as.com/schemas/dcplanlistws" xmlns:ns1="http://ws.as.com/schemas/dcquickvaluews" targetNamespace="http://ws.as.com/schemas/dcquickvaluews" elementFormDefault="qualified">
<import namespace="http://ws.as.com/schemas/dcplanlistws" schemaLocation="dcplanlistws.xsd"/>
<complexType name="REQUESTDATA">
<complexContent>
<extension base="tns2:bs-request-bean">
<sequence>
<element name="requestEntries" type="tns2 LAN" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType name="TCINFO">
<complexContent>
<extension base="tns2:bs-data-bean">
<sequence>
<element name="ERRORS" type="xsd:boolean"/>
<element name="NUMPLANS" type="xsd:boolean"/>
<element name="PLAN" type="tns2 LAN" minOccurs="0" maxOccurs="unbounded"/>
<element name="PLANVALUES" type="tns2:TCPlanValues" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</extension>
</complexContent>
</complexType>
</schema>
 
William Barnes
Ranch Hand
Posts: 1067
2
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What was the problem?
 
Rr Kumaran
Ranch Hand
Posts: 548
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Amit,

What is the problem and what is your solution ?

Thanks,
 
Amit G Piplani
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
AXIS was finding problem to find definitions of some elements. I Modified the xsd and was able to generate the necessary code.
 
Rr Kumaran
Ranch Hand
Posts: 548
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Amit,

I think you added newly this xmlns:ns1="http://ws.as.com/schemas/dcquickvaluews" but where is that you referring to this ns1 namespace prefix in either any of the xsd's or wsdl ? Can you please confirm ?
 
Amit G Piplani
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just modified XSD file for finding correct refrecned names. I think it should work withput adding that namespace defintion also.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic