If you want to support both doc/lit and rpc/encoded, define both the type
and the element as global:

<xsd:element name="BigTicket100" type="tns:BigTicket100"/>
<xsd:complexType name="BigTicket100">
   <xsd:sequence>
      <xsd:element name="Version" type="xsd:string"/>
      <xsd:element name="ID" type="xsd:string"/>
   </xsd:sequence>
</xsd:complexType>


-----Original Message-----
From: Shantanu Sen [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 30, 2004 11:49 AM
To: [EMAIL PROTECTED]
Subject: Re: WSDL and schema include question

In that case it means that based on the SOAP format
(doc-lit/rpc-encoded), I have to change my schema?
That sounds like a strange restriction. 

I can  have a fairly complex schema spanning multiple
XSD files. It may be a non-trivial task to change the
schema for using a specific SOAP format.

Is this a standard issue that is listed/discussed
anywhere?

Thanks,
Shantanu 

--- [EMAIL PROTECTED] wrote:
> 
> This doesn't seem like a WSDL2Java bug.
> In you WSDL, if you refer
> type="MyDataTypes:BigTicket100", then in your
> schema file, you **need** to defined BigTicket100
> <simpleType> or a <complexType>  (<element> will not
> do). Conversely, if
> your WSDL declares
> element="MyDataTypes:BigTicket100", then you need
> a BigTicket100 <element>.
> 
> Keep in mind though that if your web service is
> doc/literal, then you need
> to use element="MyDataTypes:BigTicket100" in your
> WSDL. If your web service
> is either rpc/encoded or rpc/literal, then you need
> to use
> type="MyDataTypes:BigTicket100".
> 
> - Junaid
> 
> 
> 
>                                                     
>                       
>              Shantanu Sen                           
>                       
>              <[EMAIL PROTECTED]                      
>                       
>              >                                      
>                    To 
>                                       
> [EMAIL PROTECTED]             
>              06/30/2004 04:48                       
>                    cc 
>              AM                                     
>                       
>                                                     
>               Subject 
>                                        Re: WSDL and
> schema include         
>              Please respond to         question     
>                       
>              [EMAIL PROTECTED]                      
>                       
>                   he.org                            
>                       
>                                                     
>                       
>                                                     
>                       
>                                                     
>                       
>                                                     
>                       
> 
> 
> 
> 
> Actually the problem has nothing to do with
> including schema files. The
> issue is that the following type declaration causes
> the error
> (java.io.IOException:
>  Type {urn:BigTicket}BigTicket100 is referenced but
> not defined)
> 
> <xsd:element name="BigTicket100">
>          <xsd:complexType>
>              <xsd:sequence>
>                 <xsd:element name="Version"
> type="xsd:string"/>
>                 <xsd:element name="ID"
> type="xsd:string"/>
>               </xsd:sequence>
>          </xsd:complexType>
>  </xsd:element>
> 
> If I change this to the following, WSDL2Java works
> fine
> 
> <xsd:complexType name="BigTicket100">
>     <xsd:sequence>
>         <xsd:element name="Version"
> type="xsd:string"/>
>         <xsd:element name="ID" type="xsd:string"/>
>     </xsd:sequence>
>  </xsd:complexType>
> 
> Any ideas if this is a WSDL2Java bug? The schema
> that causes the error
> looks legit to me.
> 
> Thanks,
> Shantanu
> -------------------
> Shantanu Sen <[EMAIL PROTECTED]> wrote:
> 
> Yes, using both the suggested options i.e using  ./
> and including namespace
> does not work.
> 
> What is really strange is that if I change the WSDL
> so that the part
> specification is an element rather than a type, then
> WSDL2Java works fine.
> 
> E.g. when I change the following
> 
> type="MyDataTypes:BigTicket100"/>
> 
> to
> 
> element="MyDataTypes:BigTicket100"/>
> 
> it works. Any ideas?
> 
> Thanks,
> Shantanu
> --- Jeff Greif wrote:
> > Sorry, this advice is incorrect.
> >
> > is a way of building up the components
> > in a single namespace
> > from separate fragment schemas. The schema
> > specified by
> > *must* have the same target namespace as the
> > including schema (or neither
> > must have a target namespace). The namespace
> > attribute should not be
> > provided and has no effect. See
> > http://www.w3.org/TR/xmlschema-1/#composition
> > (section 4.2.1). >
> > requires a namespace attribute and
> > requires that the value of
> > that attribute be different from the target
> > namespace of the importing
> > schema.
> >
> > Jeff
> > ----- Original Message -----
> > From: Anne Thomas Manes
> > To: [EMAIL PROTECTED]
> > Sent: Tuesday, June 29, 2004 8:06 AM
> > Subject: RE: WSDL and schema include question
> >
> >
> > You also must specify the namespace that you are
> > importing:
> >
> >
> >
> > > schemaLocation="./BigTicket.xsd" />
> >
> >
> >
> >
> >
> >
> > From: Hrishikesh Kumar
> > [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, June 29, 2004 3:23 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: WSDL and schema include question
> >
> >
> > You need to mention the relative path of the xsd
> in
> > the WSDL (may be
> > ./BigTick! et.xsd)
> >
> >
> >
> > Shantanu Sen
> > 06/29/2004 02:05 PM
> > Please respond to
> > [EMAIL PROTECTED]
> > [EMAIL PROTECTED]
> > cc
> > SubjectWSDL and schema include question
> >
> >
> >
> >
> >
> >
> >
> >
> > I am trying to run wsdl2java on a wsdl that
> includes
> > an XSD in the types
> > section. Here is the WSDL snippet
> >
> > ...
> > In the included BigTicket.xsd there is something
> > like:
> > > xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> > xmlns="urn:BigTicket"
> > targetNamespace="urn:BigTicket">
> >
> >
> 
=== message truncated ===

Reply via email to