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 "Yakulis, Ross (Ross)" <ya...@avaya.com> on 2004/04/14 19:32:34 UTC

Java2WSDL and WSDL2Java 1.1-> 1.2

With axis 1.1 I was able to use Java2WSDL and WSDL2Java to generate 
a web service given a some java files in RPC/Literal RPC/Encoded
Document/Encodec and Document/Literal.   

However, doing the same with 1.2 I receive errors using hte same source files.  
I assume this has to do with making the RPC literal and document literal 
support more conformant for the WS-I BP.

In particular I get the following error when generating a document/literal
wsdl file:

	Please register a typemapping/beanmapping for 'Info'
        at org.apache.axis.wsdl.fromJava.Emitter.writePartToMessage
           (Emitter.java:1717)
        at org.apache.axis.wsdl.fromJava.Emitter.writeRequestMessage
           (Emitter.java:1394)
        at org.apache.axis.wsdl.fromJava.Emitter.writeMessages(Emitter.java:1086
	 ...
       ...

However I see not place on the commandline options to specify such a mapping.
Is this a bug in Java2WSDL, or did I miss something?

Ross


------------ Java files TestService.java -----------------------
public class TestService {
	public int add(int ax, int bx) {
		return (0);
	}
    public int sub(int a1, int b1) {
		return (0);
	}
    public Info srInfo(Info info) {
		return (null);
	}
    public Info[] srArrayInfo(Info[] info) {
		return (null);
	}
    public int[] srArrayInt(int[] ints) {
		return (null);
	}
}

------------ Java files Info.java -----------------------
public class Info {
    private int age;
    private java.lang.String name;
    private java.lang.String phone;

    public Info() {
    }
    public int getAge() {
        return age;
    }
    public void setAge(int age) {
        this.age = age;
    }
    public java.lang.String getName() {
        return name;
    }
    public void setName(java.lang.String name) {
        this.name = name;
    }
    public java.lang.String getPhone() {
        return phone;
    }
    public void setPhone(java.lang.String phone) {
        this.phone = phone;
    }
}

RE: WSDL and schema include question

Posted by Anne Thomas Manes <an...@manes.net>.
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:ssen@pacbell.net] 
Sent: Wednesday, June 30, 2004 11:49 AM
To: axis-user@ws.apache.org
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 

--- Junaid.Bhatra@mro.com 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                           
>                       
>              <ssen@pacbell.net                      
>                       
>              >                                      
>                    To 
>                                       
> axis-user@ws.apache.org             
>              06/30/2004 04:48                       
>                    cc 
>              AM                                     
>                       
>                                                     
>               Subject 
>                                        Re: WSDL and
> schema include         
>              Please respond to         question     
>                       
>              axis-user@ws.apac                      
>                       
>                   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 <ss...@pacbell.net> 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: axis-user@ws.apache.org
> > 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:Hrishikesh.Kumar@caritor.com]
> > Sent: Tuesday, June 29, 2004 3:23 AM
> > To: axis-user@ws.apache.org
> > 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
> > axis-user@ws.apache.org
> > Toaxis-user@ws.apache.org
> > 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 ===


Re: WSDL and schema include question

Posted by Shantanu Sen <ss...@pacbell.net>.
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 

--- Junaid.Bhatra@mro.com 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                           
>                       
>              <ssen@pacbell.net                      
>                       
>              >                                      
>                    To 
>                                       
> axis-user@ws.apache.org             
>              06/30/2004 04:48                       
>                    cc 
>              AM                                     
>                       
>                                                     
>               Subject 
>                                        Re: WSDL and
> schema include         
>              Please respond to         question     
>                       
>              axis-user@ws.apac                      
>                       
>                   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 <ss...@pacbell.net> 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: axis-user@ws.apache.org
> > 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:Hrishikesh.Kumar@caritor.com]
> > Sent: Tuesday, June 29, 2004 3:23 AM
> > To: axis-user@ws.apache.org
> > 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
> > axis-user@ws.apache.org
> > Toaxis-user@ws.apache.org
> > 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 ===


Re: WSDL and schema include question

Posted by Ju...@mro.com.
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                                                  
             <ssen@pacbell.net                                             
             >                                                          To 
                                       axis-user@ws.apache.org             
             06/30/2004 04:48                                           cc 
             AM                                                            
                                                                   Subject 
                                       Re: WSDL and schema include         
             Please respond to         question                            
             axis-user@ws.apac                                             
                  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 <ss...@pacbell.net> 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: axis-user@ws.apache.org
> 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:Hrishikesh.Kumar@caritor.com]
> Sent: Tuesday, June 29, 2004 3:23 AM
> To: axis-user@ws.apache.org
> 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
> axis-user@ws.apache.org
> Toaxis-user@ws.apache.org
> 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">
>
>
>
>
> .....
>
> Trying to run WSDL2Java produces the following
> trace:
> java.io.IOException: Type
> {urn:BigTicket}BigTicket100 is referenced but not
> defined
> .
> at
>
org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined(Symbol
> Table.java:522)
> Am I making some mistake in defining the namespace
> in the WSDL? If so, what
> is it?
>
>
>




Re: WSDL and schema include question

Posted by Shantanu Sen <ss...@pacbell.net>.
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 <ss...@pacbell.net> 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: axis-user@ws.apache.org 
> 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:Hrishikesh.Kumar@caritor.com] 
> Sent: Tuesday, June 29, 2004 3:23 AM 
> To: axis-user@ws.apache.org 
> Subject: Re: WSDL and schema include question 
> 
> 
> You need to mention the relative path of the xsd in 
> the WSDL (may be 
> ./BigTicket.xsd) 
> 
> 
> 
> Shantanu Sen 
> 06/29/2004 02:05 PM 
> Please respond to 
> axis-user@ws.apache.org 
> Toaxis-user@ws.apache.org 
> 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"> 
> 
> 
> 
> 
> ..... 
> 
> Trying to run WSDL2Java produces the following 
> trace: 
> java.io.IOException: Type 
> {urn:BigTicket}BigTicket100 is referenced but not 
> defined 
> . 
> at 
> 
org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined(Symbol 
> Table.java:522) 
> Am I making some mistake in defining the namespace 
> in the WSDL? If so, what 
> is it? 
> 
> 
> 




Re: WSDL and schema include question

Posted by Shantanu Sen <ss...@pacbell.net>.
Yes, using both the suggested options i.e using
./<xsd_file_name> 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

<wsdl:part name="in0" 
type="MyDataTypes:BigTicket100"/> 

to 

<wsdl:part name="in0"
element="MyDataTypes:BigTicket100"/> 

it works. Any ideas?

Thanks,
Shantanu
--- Jeff Greif <jg...@alumni.princeton.edu> wrote:
> Sorry, this advice is incorrect.
> 
> <xsd:include> is a way of building up the components
> in a single namespace
> from separate fragment schemas.  The schema
> specified by <xsd:include>
> *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).
> 
> <xsd:import> 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: axis-user@ws.apache.org
> 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:
> 
> <wsdl:types>
> <xsd:schema targetNamespace="urn:BigTicket">
> <xsd:include namespace="urn:BigTicket"
> schemaLocation="./BigTicket.xsd" />
> </xsd:schema>
> </wsdl:types>
> 
> 
> 
> 
> From: Hrishikesh Kumar
> [mailto:Hrishikesh.Kumar@caritor.com]
> Sent: Tuesday, June 29, 2004 3:23 AM
> To: axis-user@ws.apache.org
> Subject: Re: WSDL and schema include question
> 
> 
> You need to mention the relative path of the xsd in
> the WSDL (may be
> ./BigTicket.xsd)
> 
> 
> 
> Shantanu Sen <ss...@pacbell.net>
> 06/29/2004 02:05 PM
> Please respond to
> axis-user@ws.apache.org
> Toaxis-user@ws.apache.org
> 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:
> <xsd:schema
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns="urn:BigTicket"
> targetNamespace="urn:BigTicket">
>  <xsd:include schemaLocation="OtherTypes.xsd"/>
>  <xsd:element name="BigTicket100">
>        <xsd:complexType>
>            <xsd:sequence>
> .....
> 
> Trying to run WSDL2Java produces the following
> trace:
> java.io.IOException: Type
> {urn:BigTicket}BigTicket100 is referenced but not
> defined
> .
>        at
>
org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined(Symbol
> Table.java:522)
> Am I making some mistake in defining the namespace
> in the WSDL? If so, what
> is it?
> 
> 
> 


Re: WSDL and schema include question

Posted by Jeff Greif <jg...@alumni.princeton.edu>.
Sorry, this advice is incorrect.

<xsd:include> is a way of building up the components in a single namespace
from separate fragment schemas.  The schema specified by <xsd:include>
*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).

<xsd:import> 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: axis-user@ws.apache.org
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:

<wsdl:types>
<xsd:schema targetNamespace="urn:BigTicket">
<xsd:include namespace="urn:BigTicket" schemaLocation="./BigTicket.xsd" />
</xsd:schema>
</wsdl:types>




From: Hrishikesh Kumar [mailto:Hrishikesh.Kumar@caritor.com]
Sent: Tuesday, June 29, 2004 3:23 AM
To: axis-user@ws.apache.org
Subject: Re: WSDL and schema include question


You need to mention the relative path of the xsd in the WSDL (may be
./BigTicket.xsd)



Shantanu Sen <ss...@pacbell.net>
06/29/2004 02:05 PM
Please respond to
axis-user@ws.apache.org
Toaxis-user@ws.apache.org
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:
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="urn:BigTicket"
targetNamespace="urn:BigTicket">
 <xsd:include schemaLocation="OtherTypes.xsd"/>
 <xsd:element name="BigTicket100">
       <xsd:complexType>
           <xsd:sequence>
.....

Trying to run WSDL2Java produces the following trace:
java.io.IOException: Type {urn:BigTicket}BigTicket100 is referenced but not
defined
.
       at
org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined(Symbol
Table.java:522)
Am I making some mistake in defining the namespace in the WSDL? If so, what
is it?



RE: WSDL and schema include question

Posted by Anne Thomas Manes <an...@manes.net>.
You also must specify the namespace that you are importing:
 
<wsdl:types> 
<xsd:schema targetNamespace="urn:BigTicket"> 
<xsd:include namespace="urn:BigTicket" schemaLocation="./BigTicket.xsd" /> 
</xsd:schema> 
</wsdl:types>
 
  _____  

From: Hrishikesh Kumar [mailto:Hrishikesh.Kumar@caritor.com] 
Sent: Tuesday, June 29, 2004 3:23 AM
To: axis-user@ws.apache.org
Subject: Re: WSDL and schema include question
 

You need to mention the relative path of the xsd in the WSDL (may be
./BigTicket.xsd) 




Shantanu Sen <ss...@pacbell.net> 
06/29/2004 02:05 PM 

Please respond to
axis-user@ws.apache.org

To
axis-user@ws.apache.org 

cc
 

Subject
WSDL 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 

<wsdl:definitions 
targetNamespace="HelloWorldDescription" 
xmlns:impl="HelloWorldDescription" 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:MyDataTypes="urn:BigTicket"> 

<wsdl:types> 
<xsd:schema targetNamespace="urn:BigTicket"> 
<xsd:include schemaLocation="BigTicket.xsd" /> 
</xsd:schema> 
</wsdl:types> 

<wsdl:message name="sayHello2Request"> 
       <wsdl:part name="in0" type="MyDataTypes:BigTicket100"/> 
</wsdl:message> 
.............. 
  
In the included BigTicket.xsd there is something like: 
<xsd:schema 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns="urn:BigTicket" 
targetNamespace="urn:BigTicket"> 
 <xsd:include schemaLocation="OtherTypes.xsd"/> 
 <xsd:element name="BigTicket100">
       <xsd:complexType>
           <xsd:sequence> 
..... 
  
Trying to run WSDL2Java produces the following trace: 
java.io.IOException: Type {urn:BigTicket}BigTicket100 is referenced but not
defined
.
       at
org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined(Symbol
Table.java:522) 
Am I making some mistake in defining the namespace in the WSDL? If so, what
is it? 
  
Thanks for any help. 
  
Shantanu Sen 

Re: WSDL and schema include question

Posted by Hrishikesh Kumar <Hr...@caritor.com>.
You need to mention the relative path of the xsd in the WSDL (may be ./
BigTicket.xsd)




Shantanu Sen <ss...@pacbell.net> 
06/29/2004 02:05 PM
Please respond to
axis-user@ws.apache.org


To
axis-user@ws.apache.org
cc

Subject
WSDL 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 

<wsdl:definitions 
targetNamespace="HelloWorldDescription" 
xmlns:impl="HelloWorldDescription" 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:MyDataTypes="urn:BigTicket"> 

<wsdl:types> 
<xsd:schema targetNamespace="urn:BigTicket"> 
<xsd:include schemaLocation="BigTicket.xsd" /> 
</xsd:schema> 
</wsdl:types> 

<wsdl:message name="sayHello2Request"> 
        <wsdl:part name="in0" type="MyDataTypes:BigTicket100"/> 
</wsdl:message>
..............
 
In the included BigTicket.xsd there is something like:
<xsd:schema 
 xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
 xmlns="urn:BigTicket" 
 targetNamespace="urn:BigTicket">
 <xsd:include schemaLocation="OtherTypes.xsd"/>
 <xsd:element name="BigTicket100">
        <xsd:complexType>
            <xsd:sequence>
.....
 
Trying to run WSDL2Java produces the following trace:
java.io.IOException: Type {urn:BigTicket}BigTicket100 is referenced but 
not defined
.
        at 
org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined(Symbol
Table.java:522)
Am I making some mistake in defining the namespace in the WSDL? If so, 
what is it?
 
Thanks for any help.
 
Shantanu Sen

WSDL and schema include question

Posted by Shantanu Sen <ss...@pacbell.net>.
I am trying to run wsdl2java on a wsdl that includes an XSD in the types section. Here is the WSDL snippet 

<wsdl:definitions 
targetNamespace="HelloWorldDescription" 
xmlns:impl="HelloWorldDescription" 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:MyDataTypes="urn:BigTicket"> 

<wsdl:types> 
<xsd:schema targetNamespace="urn:BigTicket"> 
<xsd:include schemaLocation="BigTicket.xsd" /> 
</xsd:schema> 
</wsdl:types> 

<wsdl:message name="sayHello2Request"> 
        <wsdl:part name="in0" type="MyDataTypes:BigTicket100"/> 
</wsdl:message>
..............
 
In the included BigTicket.xsd there is something like:

<xsd:schema 
 xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
 xmlns="urn:BigTicket" 
 targetNamespace="urn:BigTicket">

 <xsd:include schemaLocation="OtherTypes.xsd"/>
 <xsd:element name="BigTicket100">
        <xsd:complexType>
            <xsd:sequence>
.....
 
Trying to run WSDL2Java produces the following trace:
java.io.IOException: Type {urn:BigTicket}BigTicket100 is referenced but not defined
.
        at org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined(Symbol
Table.java:522)

Am I making some mistake in defining the namespace in the WSDL? If so, what is it?
 
Thanks for any help.
 
Shantanu Sen

Re: Java2WSDL and WSDL2Java 1.1-> 1.2

Posted by Davanum Srinivas <di...@yahoo.com>.
You can use the ant task to specify these - see
http://cvs.apache.org/viewcvs.cgi/*checkout*/ws-axis/java/samples/ejb/ant-build.xml for an
example.

-- dims

--- "Yakulis, Ross (Ross)" <ya...@avaya.com> wrote:
> With axis 1.1 I was able to use Java2WSDL and WSDL2Java to generate 
> a web service given a some java files in RPC/Literal RPC/Encoded
> Document/Encodec and Document/Literal.   
> 
> However, doing the same with 1.2 I receive errors using hte same source files.  
> I assume this has to do with making the RPC literal and document literal 
> support more conformant for the WS-I BP.
> 
> In particular I get the following error when generating a document/literal
> wsdl file:
> 
> 	Please register a typemapping/beanmapping for 'Info'
>         at org.apache.axis.wsdl.fromJava.Emitter.writePartToMessage
>            (Emitter.java:1717)
>         at org.apache.axis.wsdl.fromJava.Emitter.writeRequestMessage
>            (Emitter.java:1394)
>         at org.apache.axis.wsdl.fromJava.Emitter.writeMessages(Emitter.java:1086
> 	 ...
>        ...
> 
> However I see not place on the commandline options to specify such a mapping.
> Is this a bug in Java2WSDL, or did I miss something?
> 
> Ross
> 
> 
> ------------ Java files TestService.java -----------------------
> public class TestService {
> 	public int add(int ax, int bx) {
> 		return (0);
> 	}
>     public int sub(int a1, int b1) {
> 		return (0);
> 	}
>     public Info srInfo(Info info) {
> 		return (null);
> 	}
>     public Info[] srArrayInfo(Info[] info) {
> 		return (null);
> 	}
>     public int[] srArrayInt(int[] ints) {
> 		return (null);
> 	}
> }
> 
> ------------ Java files Info.java -----------------------
> public class Info {
>     private int age;
>     private java.lang.String name;
>     private java.lang.String phone;
> 
>     public Info() {
>     }
>     public int getAge() {
>         return age;
>     }
>     public void setAge(int age) {
>         this.age = age;
>     }
>     public java.lang.String getName() {
>         return name;
>     }
>     public void setName(java.lang.String name) {
>         this.name = name;
>     }
>     public java.lang.String getPhone() {
>         return phone;
>     }
>     public void setPhone(java.lang.String phone) {
>         this.phone = phone;
>     }
> }


=====
Davanum Srinivas - http://webservices.apache.org/~dims/