You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by c b <ch...@yahoo.com> on 2006/10/05 09:29:17 UTC
XSD With complexType definitions
Hi All,
I have this an xsd which looks something like this,
<xsd:element name="purchaseOrder" type="PurchaseOrderType"/>
<xsd:complexType name="PurchaseOrderType">
<xsd:sequence>
<xsd:element name="shipTo" type="xsd:string"/>
<xsd:element name="billTo" type="xsd:string"/>
<xsd:element ref="comment" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
But whn I try to generate code using this xsd, it gives me a exception saying type PurchaseOrderType is not found.
Why is this the case??
Thanks,
CB
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Re: XSD With complexType definitions
Posted by Anne Thomas Manes <at...@gmail.com>.
What are your namespace definitions?
If you've set the default namespace to the targetNamspace, then the
reference type="PurchaseOrderType" should work, but as a best
practice, it's a much better idea to use explicit namespaces rather
than the default namespace, e.g.,
<xsd:schema targetNamespace="urn:example:types"
xsd:types=""urn:example:types"
...>
<xsd:element name="purchaseOrder" type="types:PurchaseOrderType"/>
...
Note that you also need to qualify the element reference:
<xsd:element ref="types:comment" minOccurs="0"/>
Anne
On 10/5/06, c b <ch...@yahoo.com> wrote:
> Hi All,
> I have this an xsd which looks something like this,
>
> <xsd:element name="purchaseOrder" type="PurchaseOrderType"/>
>
> <xsd:complexType name="PurchaseOrderType">
> <xsd:sequence>
> <xsd:element name="shipTo" type="xsd:string"/>
> <xsd:element name="billTo" type="xsd:string"/>
> <xsd:element ref="comment" minOccurs="0"/>
> </xsd:sequence>
> </xsd:complexType>
>
> But whn I try to generate code using this xsd, it gives me a exception
> saying type PurchaseOrderType is not found.
>
> Why is this the case??
>
> Thanks,
> CB
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org