There already is an open issue 
<http://issues.apache.org/jira/browse/AXIS-2155> related to the problem. 
It might be a good idea to implement a solution that is flexible enough to 
allow optional elements to be omitted but also allow xsi:nil="true" if the 
element is optional and nillable.

Since the generated Java interface for a WebService with optional elements 
can only differentiate two states (value or null) it is not easy to find a 
Java solution that is able to express the three possible XML states for an 
element (value, null, not given).

For me a system property switching between "null" and "not given" output 
in XML for a "null" input in the Java method would be enough. AXIS-2155 
wants to be able to set all three states in the output from the Java 
input.

Regards,
Ulf





Anne Thomas Manes <[EMAIL PROTECTED]>
14.11.2005 13:09
Bitte antworten an axis-user
 
        An:     [email protected]
        Kopie: 
        Thema:  Re: nil = "true"


Have you tested this with Axis 1.3?
If the problem still exists, please file an enhancement request.

Anne

On 11/14/05, Parikh,Pratik <[EMAIL PROTECTED]> wrote:

I am interested in this as well.... Please reply it there is one.

Thanks,
Pratik Parikh

-----Original Message-----
From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]
Sent: Monday, November 14, 2005 2:46 AM
To: [email protected]
Subject: RE: nil = "true"

Lets bring this old topic to life again. 

Is it still not possible to make AXIS omit optional elements
(minOccurs="0")in a RPC-SOAP request if no value is given?

The Java method created for a WSDL with optional elements only leaves
the developer the choice to set any value or null for optional
parameters.
When the developer set null he means to say that he does not want to
give a value for this parameter. But what he gets in the SOAP request is 
an element containing null (xsi:null="true") instead of no element. For
service processing the request this can make a big difference. "Null"
and "not given" are two different states (in XML). It is just that the 
generated Java implementation does not allow to differentiate between
them.

There should be a setting for AXIS controlling the generation of
optional elements for null values. Is there one? Are there other 
possibilities?

Regards,
Ulf Licht



List:       axis-user
Subject:    xsi:nil="true"
From:       Seth Tager <javawebgraphics () yahoo ! com>
Date:       2003-08-14 21:53:33 

I'm having a problem with a Microsoft .NET service
(MapPoint) choking on any (I think it's any, but I'm not positive)
element that contains nil="true", as in

    <Pushpins xsi:nil="true"/> 
    <Route xsi:nil="true"/>

Axis 1.0 eliminated these elements from the request, which makes the
.NET service happy, but 1.1 includes them.

The year-old, archive message (below) seems to be related, but the wsdl 
looks like it already has minOccurs="0" maxOccurs="1" as in this
snippet:

                                                 <s:complexType
name="MapSpecification">  <s:sequence>
  <s:element minOccurs="0" maxOccurs="1"
name="Pushpins" type="s0:ArrayOfPushpin"/>
  <s:element minOccurs="0" maxOccurs="1" 
name="Route" type="s0:Route"/>
</s:sequence>
                                                 </s:complexType>

Any suggestions about how to fix, or work around this problem.

>From the archives:

Subject:  RE: nil = "true"
From:     Tom Jordahl <tomj () macromedia ! com> 
Date:     2002-07-31 13:58:51


If you are using a document/literal service, you can change the WSDL to
have \ minoccurs=0 maxoccurs=1.  Then if the value if null, it will be
omitted from the XML \ in the request/response. 

If you are using rpc/encoded, you can't do this as encoded will always
use nil=true.

See the test in java/test/wsdl/omit for an example.

--
Tom Jordahl
Macromedia


-----Original Message----- 
From: Snigdha Pandit [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 31, 2002 5:57 AM
To: Axis Users
Subject: xsi:nil = "true"


hi All,

How can I eliminate elements with xsi:nil attribute set to true? 

Thanks and Regards
Snigdha

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com 

CONFIDENTIALITY NOTICE

This message and any included attachments
are from Cerner Corporation and are intended
only for the addressee. The information
contained in this message is confidential and 
may constitute inside or non-public information
under international, federal, or state
securities laws. Unauthorized forwarding,
printing, copying, distribution, or use of such
information is strictly prohibited and may be 
unlawful. If you are not the addressee, please
promptly delete this message and notify the
sender of the delivery error by e-mail or you
may call Cerner's corporate offices in Kansas
City, Missouri, U.S.A at (+1) (816)221-1024. 
---------------------------------------- --


Reply via email to