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 Jay Glanville <Ja...@naturalconvergence.com> on 2005/03/10 17:52:04 UTC

difference in behaviour between wsdl2java command line and ant versions?

I just noticed a difference in behaviour between the command line and
ant implementations of WSDL2java.  Basically, if I use the code
generated by the ant version, I get a questionable IO Exception
generated.

Here's what happened.
1) I downloaded the auto-generated WSDL from my service

2) I ran the command line version of wsdl2java, which looked something
like this:
	java org.apache.axis.wsdl.WSDL2Java --output build/src
Telco.wsdl
Ant then ran some internal tests, sending an object to my server.
Everything worked out fine.

3) I then cleaned up my system (removed all derived objects) and ran the
ant version of wsdl2java, which looked something like this:
        <axis-wsdl2java
            output="${src.generated}"
            verbose="true"
            url="${wsdlfile}"
            />
And then ran the same tests again.  However, this time I received a
"non-nillable element is nill" exception:
	java.io.IOException: Non nillable element \
		'afternoonGreetingFilename' is null.
	at org.apache.axis.encoding.ser.BeanSerializer\
		.serialize(BeanSerializer.java:200)
	at org.apache.axis.encoding.SerializationContext\
		.serializeActual(SerializationContext.java:1415)
	...
Here is a snippet of the WSDL document:
   <complexType name="AutoAttendant">
    <sequence>
     <element name="TODGreetings" type="xsd:boolean"/>
     <element name="afternoonGreetingFilename" 
		nillable="true" type="soapenc:string"/>
     <element name="afternoonGreetingPromptText" 
		nillable="true" type="soapenc:string"/>
     <element name="afternoonGreetingRecorded" type="xsd:boolean"/>
So, my WSDL document says that this element IS nillable, but the code is
throwing an IOException saying it's non-nillable.


So, to recap,
- the server was the same
- the WSDL document used to generate the client code was the same
- the WSDL element is nillable
- the command line version of wsdl2java didn't have any problems
- the ant version of wsdl2java threw an IO exception, saying the
nillable element is non-nillable


Has anyone else seen this problem?  Is it a known issue?

Thanks




JDG
PS: I'm using 1.2rc3
 
---
Jay Glanville

Re: difference in behaviour between wsdl2java command line and ant versions?

Posted by Davanum Srinivas <da...@gmail.com>.
Please open a bug report with the various wsdl's that you used (and
those that got generated etc)

thanks,
dims


On Thu, 10 Mar 2005 11:52:04 -0500, Jay Glanville
<Ja...@naturalconvergence.com> wrote:
> I just noticed a difference in behaviour between the command line and
> ant implementations of WSDL2java.  Basically, if I use the code
> generated by the ant version, I get a questionable IO Exception
> generated.
> 
> Here's what happened.
> 1) I downloaded the auto-generated WSDL from my service
> 
> 2) I ran the command line version of wsdl2java, which looked something
> like this:
>         java org.apache.axis.wsdl.WSDL2Java --output build/src
> Telco.wsdl
> Ant then ran some internal tests, sending an object to my server.
> Everything worked out fine.
> 
> 3) I then cleaned up my system (removed all derived objects) and ran the
> ant version of wsdl2java, which looked something like this:
>         <axis-wsdl2java
>             output="${src.generated}"
>             verbose="true"
>             url="${wsdlfile}"
>             />
> And then ran the same tests again.  However, this time I received a
> "non-nillable element is nill" exception:
>         java.io.IOException: Non nillable element \
>                 'afternoonGreetingFilename' is null.
>         at org.apache.axis.encoding.ser.BeanSerializer\
>                 .serialize(BeanSerializer.java:200)
>         at org.apache.axis.encoding.SerializationContext\
>                 .serializeActual(SerializationContext.java:1415)
>         ...
> Here is a snippet of the WSDL document:
>    <complexType name="AutoAttendant">
>     <sequence>
>      <element name="TODGreetings" type="xsd:boolean"/>
>      <element name="afternoonGreetingFilename"
>                 nillable="true" type="soapenc:string"/>
>      <element name="afternoonGreetingPromptText"
>                 nillable="true" type="soapenc:string"/>
>      <element name="afternoonGreetingRecorded" type="xsd:boolean"/>
> So, my WSDL document says that this element IS nillable, but the code is
> throwing an IOException saying it's non-nillable.
> 
> So, to recap,
> - the server was the same
> - the WSDL document used to generate the client code was the same
> - the WSDL element is nillable
> - the command line version of wsdl2java didn't have any problems
> - the ant version of wsdl2java threw an IO exception, saying the
> nillable element is non-nillable
> 
> Has anyone else seen this problem?  Is it a known issue?
> 
> Thanks
> 
> JDG
> PS: I'm using 1.2rc3
> 
> ---
> Jay Glanville
> 


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