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

Reply via email to