File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes Importing xsd into wsdl Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Importing xsd into wsdl" Watch "Importing xsd into wsdl" New topic

Importing xsd into wsdl

Ranadhir Nag
Ranch Hand

Joined: Mar 09, 2006
Posts: 138
This is my current configuration:


However,the moment ref="Stock" is changed to type="Stock",the wsdl2java starts giving Type {}Stock is referenced but not defined.

Somehow it seems a clash between wsdl and xsd imports - but I just cant resolve it.Help is appreciated.
g tsuji
Ranch Hand

Joined: Jan 18, 2011
Posts: 630
<xsd:element name="stock" ref="Stock" minOccurs="1" maxOccurs="unbounded"/>

This won't ever be a valid construction.

[1.1] Either you want the element at that location be called "Stock" (with the upper s) and reference the global element so defined up there at the top-level. In this case, you simply reference to it like this.

[1.2] Or you want the element at that location be called "stock" with the structure in mind as that global element named "Stock" (with the upper s). In that case, you rename the global element to "stock".

and reference it like this.

[2] Note also that you can reference to Stock/stock without prefix and that you can say type="Quote" without prefix are simply due to you having a default namespace defined which happens to coincide with the targetNamespace; if not, a prefix is needed to result in a fully-qualified name as value for the ref and type attributes.
I agree. Here's the link:
subject: Importing xsd into wsdl
jQuery in Action, 3rd edition