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 José Antonio Sánchez <ge...@gmail.com> on 2006/05/05 15:54:50 UTC
[Axis2 1.0]Bug? when generating java from WSDL
I have a working web service deployed in Axis 1.3 so I tested if I can
port it to Axis2.
I downloaded the Axis2 binary distribution and ecipse plugin. First I
created the FaultToleranceService interface and the FTAction class
that were the starting point of my old service. They are attached.
Using the Eclipse generation wizard, I successfully created the
attached wsdl file but when I try to generate the java server and stub
code from it I get the following error:
Exception in thread "main"
org.apache.axis2.wsdl.codegen.CodeGenerationException:
java.lang.RuntimeException: java.lang.RuntimeException: Schema for
namespace 'http://tomas.org/faultTolerance/Service/Types' already
contains type 'FTAction
I tried with the Eclipse code generation wizard and manually with the
wsdl2java class and the result is the same.
I understand that, as the wsdl code is generated from an Axis2 tool,
it must be understood by another Axis2 tool without this kind of
problems.
--
Regards.
José Antonio Sánchez
Re: [Axis2 1.0]Bug? when generating java from WSDL
Posted by José Antonio Sánchez <ge...@gmail.com>.
On 5/5/06, José Antonio Sánchez <ge...@gmail.com> wrote:
> If I start with the wsdl from the working service, I get the same error.
> The two classes (FTAction and FaultToleranceService interface) are
> written by me, although they were writter for the Axis1 service, they
> are not generated at all and so, they should generate a good WSDL file
> with Axis2.
> On 5/5/06, Anne Thomas Manes <at...@gmail.com> wrote:
> > Jose,
> >
> > The schema has two identical definitions of the FTAction type. Which is
> > obviously an error. The WSDL also imports another schema with a namespace of
> > "http://ft.tomas.org/xsd ", which also defines the FTAction type, and your
> > elements reference this imported type rather than one from the
> > "http://tomas.org/faultTolerance/Service/Types " namespace.
> >
> > Did you create a new interface and class to generate your WSDL or did you
> > use the class previously generated by Axis1?
> >
> > I suggest you start completely from scratch. Or better yet -- start from the
> > WSDL from your working web service.
> >
> > Anne
> >
> >
> > On 5/5/06, José Antonio Sánchez <ge...@gmail.com> wrote:
> > > I have a working web service deployed in Axis 1.3 so I tested if I can
> > > port it to Axis2.
> > > I downloaded the Axis2 binary distribution and ecipse plugin. First I
> > > created the FaultToleranceService interface and the FTAction class
> > > that were the starting point of my old service. They are attached.
> > > Using the Eclipse generation wizard, I successfully created the
> > > attached wsdl file but when I try to generate the java server and stub
> > > code from it I get the following error:
> > >
> > > Exception in thread "main"
> > > org.apache.axis2.wsdl.codegen.CodeGenerationException:
> > > java.lang.RuntimeException: java.lang.RuntimeException: Schema for
> > > namespace '
> > http://tomas.org/faultTolerance/Service/Types' already
> > > contains type 'FTAction
> > >
> > > I tried with the Eclipse code generation wizard and manually with the
> > > wsdl2java class and the result is the same.
> > > I understand that, as the wsdl code is generated from an Axis2 tool,
> > > it must be understood by another Axis2 tool without this kind of
> > > problems.
> > > --
> > > Regards.
> > > José Antonio Sánchez
> > >
> > >
> > >
> >
> >
>
>
> --
> Saludos.
> José Antonio Sánchez
>
--
Saludos.
José Antonio Sánchez
Re: [Axis2 1.0]Bug? when generating java from WSDL
Posted by José Antonio Sánchez <ge...@gmail.com>.
I checked it with the wsdl generated by Axis 1.3. It's attached and it
seems to work. So the problem is not with the wsdl2java but with the
java2wsdl process.
On 5/5/06, José Antonio Sánchez <ge...@gmail.com> wrote:
> If I start with the wsdl from the working service, I get the same error.
> The two classes (FTAction and FaultToleranceService interface) are
> written by me, although they were writter for the Axis1 service, they
> are not generated at all and so, they should generate a good WSDL file
> with Axis2.
> On 5/5/06, Anne Thomas Manes <at...@gmail.com> wrote:
> > Jose,
> >
> > The schema has two identical definitions of the FTAction type. Which is
> > obviously an error. The WSDL also imports another schema with a namespace of
> > "http://ft.tomas.org/xsd ", which also defines the FTAction type, and your
> > elements reference this imported type rather than one from the
> > "http://tomas.org/faultTolerance/Service/Types " namespace.
> >
> > Did you create a new interface and class to generate your WSDL or did you
> > use the class previously generated by Axis1?
> >
> > I suggest you start completely from scratch. Or better yet -- start from the
> > WSDL from your working web service.
> >
> > Anne
> >
> >
> > On 5/5/06, José Antonio Sánchez <ge...@gmail.com> wrote:
> > > I have a working web service deployed in Axis 1.3 so I tested if I can
> > > port it to Axis2.
> > > I downloaded the Axis2 binary distribution and ecipse plugin. First I
> > > created the FaultToleranceService interface and the FTAction class
> > > that were the starting point of my old service. They are attached.
> > > Using the Eclipse generation wizard, I successfully created the
> > > attached wsdl file but when I try to generate the java server and stub
> > > code from it I get the following error:
> > >
> > > Exception in thread "main"
> > > org.apache.axis2.wsdl.codegen.CodeGenerationException:
> > > java.lang.RuntimeException: java.lang.RuntimeException: Schema for
> > > namespace '
> > http://tomas.org/faultTolerance/Service/Types' already
> > > contains type 'FTAction
> > >
> > > I tried with the Eclipse code generation wizard and manually with the
> > > wsdl2java class and the result is the same.
> > > I understand that, as the wsdl code is generated from an Axis2 tool,
> > > it must be understood by another Axis2 tool without this kind of
> > > problems.
> > > --
> > > Regards.
> > > José Antonio Sánchez
> > >
> > >
> > >
> >
> >
>
>
> --
> Saludos.
> José Antonio Sánchez
>
--
Saludos.
José Antonio Sánchez
Re: [Axis2 1.0]Bug? when generating java from WSDL
Posted by José Antonio Sánchez <ge...@gmail.com>.
If I start with the wsdl from the working service, I get the same error.
The two classes (FTAction and FaultToleranceService interface) are
written by me, although they were writter for the Axis1 service, they
are not generated at all and so, they should generate a good WSDL file
with Axis2.
On 5/5/06, Anne Thomas Manes <at...@gmail.com> wrote:
> Jose,
>
> The schema has two identical definitions of the FTAction type. Which is
> obviously an error. The WSDL also imports another schema with a namespace of
> "http://ft.tomas.org/xsd ", which also defines the FTAction type, and your
> elements reference this imported type rather than one from the
> "http://tomas.org/faultTolerance/Service/Types " namespace.
>
> Did you create a new interface and class to generate your WSDL or did you
> use the class previously generated by Axis1?
>
> I suggest you start completely from scratch. Or better yet -- start from the
> WSDL from your working web service.
>
> Anne
>
>
> On 5/5/06, José Antonio Sánchez <ge...@gmail.com> wrote:
> > I have a working web service deployed in Axis 1.3 so I tested if I can
> > port it to Axis2.
> > I downloaded the Axis2 binary distribution and ecipse plugin. First I
> > created the FaultToleranceService interface and the FTAction class
> > that were the starting point of my old service. They are attached.
> > Using the Eclipse generation wizard, I successfully created the
> > attached wsdl file but when I try to generate the java server and stub
> > code from it I get the following error:
> >
> > Exception in thread "main"
> > org.apache.axis2.wsdl.codegen.CodeGenerationException:
> > java.lang.RuntimeException: java.lang.RuntimeException: Schema for
> > namespace '
> http://tomas.org/faultTolerance/Service/Types' already
> > contains type 'FTAction
> >
> > I tried with the Eclipse code generation wizard and manually with the
> > wsdl2java class and the result is the same.
> > I understand that, as the wsdl code is generated from an Axis2 tool,
> > it must be understood by another Axis2 tool without this kind of
> > problems.
> > --
> > Regards.
> > José Antonio Sánchez
> >
> >
> >
>
>
--
Saludos.
José Antonio Sánchez
passing boxed type parameter using rpc/lit
Posted by Shantanu Sen <ss...@pacbell.net>.
I have an SEI method as follows:
public interface MySEI extends Remote {
public Integer add(int a, Integer b, int c, int d) throws RemoteException;
}
When the java2wsdl is run (Axis 1.4) the input message generated with various styles are as follows:
rpc/enc:
----------
<wsdl:message name="addRequest">
<wsdl:part name="in0" type="xsd:int"/>
<wsdl:part name="in1" type="soapenc:int"/>
<wsdl:part name="in2" type="xsd:int"/>
<wsdl:part name="in3" type="xsd:int"/>
</wsdl:message>
----------
doc/lit(wrapped)
----------
<element name="add">
<complexType>
<sequence>
<element name="in0" type="xsd:int"/>
<element name="in1" type="xsd:int"/>
<element name="in2" type="xsd:int"/>
<element name="in3" type="xsd:int"/>
</sequence>
</complexType>
</element>
...
<wsdl:message name="addRequest">
<wsdl:part element="impl:add" name="parameters"/>
</wsdl:message>
----------
rpc/lit
-------
<wsdl:message name="addRequest">
<wsdl:part name="in0" type="xsd:int"/>
<wsdl:part name="in1" type="xsd:int"/>
<wsdl:part name="in2" type="xsd:int"/>
<wsdl:part name="in3" type="xsd:int"/>
</wsdl:message>
------
So, if we generate the SEI from the WSDLs, only the rpc/enc produces the correct original SEI. The others produce:
public interface MySEI extends java.rmi.Remote {
public int add(int in0, int in1, int in2, int in3) throws java.rmi.RemoteException;
}
which is incorrect.
My question is for rpc/lit should'nt it generate the nillable="true" in the part e.g.
<wsdl:part name="in1" type="xsd:int" nillable="true"/>
so that it is maaped to a java.lang.Integer?
Can't we use wrapped primitive types with rpc/lit?
The doc/lit(wrapped) generation looks like a bug - it should definitely have set the nillable="true". But I am not sure about the rpc./lit
How can I make the tool generate the correct type using rpc/lit?
Any comments welcome.
Shantanu
Re: [Axis2 1.0]Bug? when generating java from WSDL
Posted by Anne Thomas Manes <at...@gmail.com>.
Jose,
The schema has two identical definitions of the FTAction type. Which is
obviously an error. The WSDL also imports another schema with a namespace of
"http://ft.tomas.org/xsd", which also defines the FTAction type, and your
elements reference this imported type rather than one from the "
http://tomas.org/faultTolerance/Service/Types" namespace.
Did you create a new interface and class to generate your WSDL or did you
use the class previously generated by Axis1?
I suggest you start completely from scratch. Or better yet -- start from the
WSDL from your working web service.
Anne
On 5/5/06, José Antonio Sánchez <ge...@gmail.com> wrote:
>
> I have a working web service deployed in Axis 1.3 so I tested if I can
> port it to Axis2.
> I downloaded the Axis2 binary distribution and ecipse plugin. First I
> created the FaultToleranceService interface and the FTAction class
> that were the starting point of my old service. They are attached.
> Using the Eclipse generation wizard, I successfully created the
> attached wsdl file but when I try to generate the java server and stub
> code from it I get the following error:
>
> Exception in thread "main"
> org.apache.axis2.wsdl.codegen.CodeGenerationException:
> java.lang.RuntimeException: java.lang.RuntimeException: Schema for
> namespace 'http://tomas.org/faultTolerance/Service/Types' already
> contains type 'FTAction
>
> I tried with the Eclipse code generation wizard and manually with the
> wsdl2java class and the result is the same.
> I understand that, as the wsdl code is generated from an Axis2 tool,
> it must be understood by another Axis2 tool without this kind of
> problems.
> --
> Regards.
> José Antonio Sánchez
>
>
>