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 Tim James McConechy <Ti...@infor.com> on 2008/06/17 21:34:51 UTC
Axis Generates All Fields Not Nullable
Hi,
When I run wsdl2java from a .NET 1.1 web service axis adds code such as:
if (localitemCode ==null){
// write the nil attribute
throw new org.apache.axis2.databinding.ADBException("itemCode cannot be
null!!");
The WSDL looks like:
<s:element minOccurs="0" maxOccurs="1" name="itemCode" type="s:string"/>
Why does it generate the field as required? Can I make it not do this?
Previously on axis 1.4 I would change setNillable(false) to
setNillable(true).
Thanks in advance
Tim McConechy | Principal Software Engineer | Infor | Office:
610.407.8191 | Mobile: 610.306.6603 | tim.mcconechy@infor.com
Re: Axis Generates All Fields Not Nullable
Posted by keith chapman <ke...@gmail.com>.
oops. Sorry about that. Here you are
http://www.ibm.com/developerworks/webservices/library/ws-tip-null.html ;).
Thanks,
Keith.
On Thu, Jun 19, 2008 at 8:21 PM, Tim James McConechy <
TimJames.McConechy@infor.com> wrote:
> Hi Keith,
>
> I didn't see an article..
>
>
>
> Thanks
>
> Tim
>
>
>
>
> ------------------------------
>
> *From:* keith chapman [mailto:keithgchapman@gmail.com]
> *Sent:* Thursday, June 19, 2008 10:16 AM
>
> *To:* axis-user@ws.apache.org
> *Subject:* Re: Axis Generates All Fields Not Nullable
>
>
>
> Hi Tim,
>
> Here is a nice article that explains minoccurs vs nillable. (It also shows
> how it appears in the WSDL)
>
> Thanks,
> Keith.
>
> On Thu, Jun 19, 2008 at 6:43 PM, Tim James McConechy <
> TimJames.McConechy@infor.com> wrote:
>
> Hi Keith,
>
>
> So whats the difference between not present and null? If these are on an
> object… I pass my object to the routine it has the properties fx..
>
>
>
> Item.ItemCode (String)
>
> Item.effEndDate (Date)
>
>
>
> I don't set these properties because I don't need them…And pass the object
> to the web method..Then I get the errors that effEndDate cannot be null
> since it has as you say minOccurs="0" and nillable ommited…So how would I
> "not provide" this element since its part of an object….
>
>
>
> How should the wsdl look to allow that?
>
>
>
> Thanks
>
> Tim
>
>
>
>
>
>
> ------------------------------
>
> *From:* keith chapman [mailto:keithgchapman@gmail.com]
> *Sent:* Tuesday, June 17, 2008 11:25 PM
>
>
> *To:* axis-user@ws.apache.org
> *Subject:* Re: Axis Generates All Fields Not Nullable
>
>
>
> According to your WSDL it has minOccurs="0" which means that this element
> is optional. But it does not state that nillable="true" which means that if
> this element is present its value cannot be null. I'm not an ADB expert but
> this is how it should be according to your WSDL.
>
> Thanks,
> Keith.
>
> On Wed, Jun 18, 2008 at 1:04 AM, Tim James McConechy <
> TimJames.McConechy@infor.com> wrote:
>
> Hi,
>
> When I run wsdl2java from a .NET 1.1 web service axis adds code such as:
>
>
>
> if (localitemCode ==null){
>
> // write the nil attribute
>
> throw new org.apache.axis2.databinding.ADBException("itemCode cannot be
> null!!");
>
>
>
> The WSDL looks like:
>
>
>
> <s:element minOccurs="0" maxOccurs="1" name="itemCode" type="s:string"/>
>
>
>
> Why does it generate the field as required? Can I make it not do this?
> Previously on axis 1.4 I would change setNillable(false) to
> setNillable(true).
>
>
>
> Thanks in advance
>
> Tim McConechy | Principal Software Engineer | *Infor *| Office:
> 610.407.8191 | Mobile: 610.306.6603 | *tim.mcconechy@infor.com*
>
>
>
>
>
>
> --
> Keith Chapman
> Senior Software Engineer
> WSO2 Inc.
> Oxygenating the Web Service Platform.
> http://wso2.org/
>
> blog: http://www.keith-chapman.org
>
>
>
>
> --
> Keith Chapman
> Senior Software Engineer
> WSO2 Inc.
> Oxygenating the Web Service Platform.
> http://wso2.org/
>
> blog: http://www.keith-chapman.org
>
--
Keith Chapman
Senior Software Engineer
WSO2 Inc.
Oxygenating the Web Service Platform.
http://wso2.org/
blog: http://www.keith-chapman.org
RE: Axis Generates All Fields Not Nullable
Posted by Tim James McConechy <Ti...@infor.com>.
Hi Keith,
I didn't see an article..
Thanks
Tim
________________________________
From: keith chapman [mailto:keithgchapman@gmail.com]
Sent: Thursday, June 19, 2008 10:16 AM
To: axis-user@ws.apache.org
Subject: Re: Axis Generates All Fields Not Nullable
Hi Tim,
Here is a nice article that explains minoccurs vs nillable. (It also
shows how it appears in the WSDL)
Thanks,
Keith.
On Thu, Jun 19, 2008 at 6:43 PM, Tim James McConechy
<Ti...@infor.com> wrote:
Hi Keith,
So whats the difference between not present and null? If these are on an
object... I pass my object to the routine it has the properties fx..
Item.ItemCode (String)
Item.effEndDate (Date)
I don't set these properties because I don't need them...And pass the
object to the web method..Then I get the errors that effEndDate cannot
be null since it has as you say minOccurs="0" and nillable ommited...So
how would I "not provide" this element since its part of an object....
How should the wsdl look to allow that?
Thanks
Tim
________________________________
From: keith chapman [mailto:keithgchapman@gmail.com]
Sent: Tuesday, June 17, 2008 11:25 PM
To: axis-user@ws.apache.org
Subject: Re: Axis Generates All Fields Not Nullable
According to your WSDL it has minOccurs="0" which means that this
element is optional. But it does not state that nillable="true" which
means that if this element is present its value cannot be null. I'm not
an ADB expert but this is how it should be according to your WSDL.
Thanks,
Keith.
On Wed, Jun 18, 2008 at 1:04 AM, Tim James McConechy
<Ti...@infor.com> wrote:
Hi,
When I run wsdl2java from a .NET 1.1 web service axis adds code such as:
if (localitemCode ==null){
// write the nil attribute
throw new org.apache.axis2.databinding.ADBException("itemCode cannot be
null!!");
The WSDL looks like:
<s:element minOccurs="0" maxOccurs="1" name="itemCode" type="s:string"/>
Why does it generate the field as required? Can I make it not do this?
Previously on axis 1.4 I would change setNillable(false) to
setNillable(true).
Thanks in advance
Tim McConechy | Principal Software Engineer | Infor | Office:
610.407.8191 | Mobile: 610.306.6603 | tim.mcconechy@infor.com
--
Keith Chapman
Senior Software Engineer
WSO2 Inc.
Oxygenating the Web Service Platform.
http://wso2.org/
blog: http://www.keith-chapman.org
--
Keith Chapman
Senior Software Engineer
WSO2 Inc.
Oxygenating the Web Service Platform.
http://wso2.org/
blog: http://www.keith-chapman.org
Re: Axis Generates All Fields Not Nullable
Posted by keith chapman <ke...@gmail.com>.
Hi Tim,
Here is a nice article that explains minoccurs vs nillable. (It also shows
how it appears in the WSDL)
Thanks,
Keith.
On Thu, Jun 19, 2008 at 6:43 PM, Tim James McConechy <
TimJames.McConechy@infor.com> wrote:
> Hi Keith,
>
>
> So whats the difference between not present and null? If these are on an
> object… I pass my object to the routine it has the properties fx..
>
>
>
> Item.ItemCode (String)
>
> Item.effEndDate (Date)
>
>
>
> I don't set these properties because I don't need them…And pass the object
> to the web method..Then I get the errors that effEndDate cannot be null
> since it has as you say minOccurs="0" and nillable ommited…So how would I
> "not provide" this element since its part of an object….
>
>
>
> How should the wsdl look to allow that?
>
>
>
> Thanks
>
> Tim
>
>
>
>
>
>
> ------------------------------
>
> *From:* keith chapman [mailto:keithgchapman@gmail.com]
> *Sent:* Tuesday, June 17, 2008 11:25 PM
> *To:* axis-user@ws.apache.org
> *Subject:* Re: Axis Generates All Fields Not Nullable
>
>
>
> According to your WSDL it has minOccurs="0" which means that this element
> is optional. But it does not state that nillable="true" which means that if
> this element is present its value cannot be null. I'm not an ADB expert but
> this is how it should be according to your WSDL.
>
> Thanks,
> Keith.
>
> On Wed, Jun 18, 2008 at 1:04 AM, Tim James McConechy <
> TimJames.McConechy@infor.com> wrote:
>
> Hi,
>
> When I run wsdl2java from a .NET 1.1 web service axis adds code such as:
>
>
>
> if (localitemCode ==null){
>
> // write the nil attribute
>
> throw new org.apache.axis2.databinding.ADBException("itemCode cannot be
> null!!");
>
>
>
> The WSDL looks like:
>
>
>
> <s:element minOccurs="0" maxOccurs="1" name="itemCode" type="s:string"/>
>
>
>
> Why does it generate the field as required? Can I make it not do this?
> Previously on axis 1.4 I would change setNillable(false) to
> setNillable(true).
>
>
>
> Thanks in advance
>
> Tim McConechy | Principal Software Engineer | *Infor *| Office:
> 610.407.8191 | Mobile: 610.306.6603 | *tim.mcconechy@infor.com*
>
>
>
>
>
>
> --
> Keith Chapman
> Senior Software Engineer
> WSO2 Inc.
> Oxygenating the Web Service Platform.
> http://wso2.org/
>
> blog: http://www.keith-chapman.org
>
--
Keith Chapman
Senior Software Engineer
WSO2 Inc.
Oxygenating the Web Service Platform.
http://wso2.org/
blog: http://www.keith-chapman.org
RE: Axis Generates All Fields Not Nullable
Posted by Tim James McConechy <Ti...@infor.com>.
Hi Keith,
So whats the difference between not present and null? If these are on an
object... I pass my object to the routine it has the properties fx..
Item.ItemCode (String)
Item.effEndDate (Date)
I don't set these properties because I don't need them...And pass the
object to the web method..Then I get the errors that effEndDate cannot
be null since it has as you say minOccurs="0" and nillable ommited...So
how would I "not provide" this element since its part of an object....
How should the wsdl look to allow that?
Thanks
Tim
________________________________
From: keith chapman [mailto:keithgchapman@gmail.com]
Sent: Tuesday, June 17, 2008 11:25 PM
To: axis-user@ws.apache.org
Subject: Re: Axis Generates All Fields Not Nullable
According to your WSDL it has minOccurs="0" which means that this
element is optional. But it does not state that nillable="true" which
means that if this element is present its value cannot be null. I'm not
an ADB expert but this is how it should be according to your WSDL.
Thanks,
Keith.
On Wed, Jun 18, 2008 at 1:04 AM, Tim James McConechy
<Ti...@infor.com> wrote:
Hi,
When I run wsdl2java from a .NET 1.1 web service axis adds code such as:
if (localitemCode ==null){
// write the nil attribute
throw new org.apache.axis2.databinding.ADBException("itemCode cannot be
null!!");
The WSDL looks like:
<s:element minOccurs="0" maxOccurs="1" name="itemCode" type="s:string"/>
Why does it generate the field as required? Can I make it not do this?
Previously on axis 1.4 I would change setNillable(false) to
setNillable(true).
Thanks in advance
Tim McConechy | Principal Software Engineer | Infor | Office:
610.407.8191 | Mobile: 610.306.6603 | tim.mcconechy@infor.com
--
Keith Chapman
Senior Software Engineer
WSO2 Inc.
Oxygenating the Web Service Platform.
http://wso2.org/
blog: http://www.keith-chapman.org
Re: Axis Generates All Fields Not Nullable
Posted by keith chapman <ke...@gmail.com>.
According to your WSDL it has minOccurs="0" which means that this element is
optional. But it does not state that nillable="true" which means that if
this element is present its value cannot be null. I'm not an ADB expert but
this is how it should be according to your WSDL.
Thanks,
Keith.
On Wed, Jun 18, 2008 at 1:04 AM, Tim James McConechy <
TimJames.McConechy@infor.com> wrote:
> Hi,
>
> When I run wsdl2java from a .NET 1.1 web service axis adds code such as:
>
>
>
> if (localitemCode ==null){
>
> // write the nil attribute
>
> throw new org.apache.axis2.databinding.ADBException("itemCode cannot be
> null!!");
>
>
>
> The WSDL looks like:
>
>
>
> <s:element minOccurs="0" maxOccurs="1" name="itemCode" type="s:string"/>
>
>
>
> Why does it generate the field as required? Can I make it not do this?
> Previously on axis 1.4 I would change setNillable(false) to
> setNillable(true).
>
>
>
> Thanks in advance
>
> Tim McConechy | Principal Software Engineer | *Infor *| Office:
> 610.407.8191 | Mobile: 610.306.6603 | *tim.mcconechy@infor.com***
>
>
>
--
Keith Chapman
Senior Software Engineer
WSO2 Inc.
Oxygenating the Web Service Platform.
http://wso2.org/
blog: http://www.keith-chapman.org
Re: Axis Generates All Fields Not Nullable
Posted by Amila Suriarachchi <am...@gmail.com>.
if the minOccurs="0" that attribute can be null.
if you care fully look at your code,
the code segment you have withing this if statement.
} if (localItemCodeTracker){
so that code segment execute only if localItemCodeTracker is ture.
Here how the localItemCodeTracker is set.
if (param != null){
//update the setting tracker
localItemCodeTracker = true;
} else {
localItemCodeTracker = false;
}
so if the param == null the localItemCodeTracker is false and nothing
happens. i.e no element send means
it takes the minOccurs="0"
Try with some sample values.
thanks,
Amila.
On Wed, Jun 18, 2008 at 6:31 PM, Tim James McConechy <
TimJames.McConechy@infor.com> wrote:
> Here is the WSDL, not sure what you mean by the comment "this should be
> the generated code".
>
> Thanks Though
>
>
> ------------------------------
>
> *From:* Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com]
> *Sent:* Wednesday, June 18, 2008 5:42 AM
> *To:* axis-user@ws.apache.org
> *Subject:* Re: Axis Generates All Fields Not Nullable
>
>
>
> Can you send your wsdl? this should be be the generated code.
>
> thanks,
> Amila.
>
> On Wed, Jun 18, 2008 at 1:04 AM, Tim James McConechy <
> TimJames.McConechy@infor.com> wrote:
>
> Hi,
>
> When I run wsdl2java from a .NET 1.1 web service axis adds code such as:
>
>
>
> if (localitemCode ==null){
>
> // write the nil attribute
>
> throw new org.apache.axis2.databinding.ADBException("itemCode cannot be
> null!!");
>
>
>
> The WSDL looks like:
>
>
>
> <s:element minOccurs="0" maxOccurs="1" name="itemCode" type="s:string"/>
>
>
>
> Why does it generate the field as required? Can I make it not do this?
> Previously on axis 1.4 I would change setNillable(false) to
> setNillable(true).
>
>
>
> Thanks in advance
>
> Tim McConechy | Principal Software Engineer | *Infor *| Office:
> 610.407.8191 | Mobile: 610.306.6603 | *tim.mcconechy@infor.com*
>
>
>
>
>
>
> --
> Amila Suriarachchi,
> WSO2 Inc.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
--
Amila Suriarachchi,
WSO2 Inc.
RE: Axis Generates All Fields Not Nullable
Posted by Tim James McConechy <Ti...@infor.com>.
Here is the WSDL, not sure what you mean by the comment "this should be
the generated code".
Thanks Though
________________________________
From: Amila Suriarachchi [mailto:amilasuriarachchi@gmail.com]
Sent: Wednesday, June 18, 2008 5:42 AM
To: axis-user@ws.apache.org
Subject: Re: Axis Generates All Fields Not Nullable
Can you send your wsdl? this should be be the generated code.
thanks,
Amila.
On Wed, Jun 18, 2008 at 1:04 AM, Tim James McConechy <
TimJames.McConechy@infor.com> wrote:
Hi,
When I run wsdl2java from a .NET 1.1 web service axis adds code such as:
if (localitemCode ==null){
// write the nil attribute
throw new org.apache.axis2.databinding.ADBException("itemCode cannot be
null!!");
The WSDL looks like:
<s:element minOccurs="0" maxOccurs="1" name="itemCode" type="s:string"/>
Why does it generate the field as required? Can I make it not do this?
Previously on axis 1.4 I would change setNillable(false) to
setNillable(true).
Thanks in advance
Tim McConechy | Principal Software Engineer | Infor | Office:
610.407.8191 | Mobile: 610.306.6603 | tim.mcconechy@infor.com
--
Amila Suriarachchi,
WSO2 Inc.
Re: Axis Generates All Fields Not Nullable
Posted by Amila Suriarachchi <am...@gmail.com>.
Can you send your wsdl? this should be be the generated code.
thanks,
Amila.
On Wed, Jun 18, 2008 at 1:04 AM, Tim James McConechy <
TimJames.McConechy@infor.com> wrote:
> Hi,
>
> When I run wsdl2java from a .NET 1.1 web service axis adds code such as:
>
>
>
> if (localitemCode ==null){
>
> // write the nil attribute
>
> throw new org.apache.axis2.databinding.ADBException("itemCode cannot be
> null!!");
>
>
>
> The WSDL looks like:
>
>
>
> <s:element minOccurs="0" maxOccurs="1" name="itemCode" type="s:string"/>
>
>
>
> Why does it generate the field as required? Can I make it not do this?
> Previously on axis 1.4 I would change setNillable(false) to
> setNillable(true).
>
>
>
> Thanks in advance
>
> Tim McConechy | Principal Software Engineer | *Infor *| Office:
> 610.407.8191 | Mobile: 610.306.6603 | *tim.mcconechy@infor.com***
>
>
>
--
Amila Suriarachchi,
WSO2 Inc.