axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom Jordahl" <t...@macromedia.com>
Subject RE: losing placeholder when nillable="true" and minOccurs="0" attributes on the same element
Date Fri, 18 Nov 2005 21:05:12 GMT
There are only two states a java variable can be in - null or not.

We are mapping these states to three XML states: omitted, null and
having a value.

 

Axis prefers to omit a value if minOccurs=0.  This is certainly OK if
the schema says it is.  It just happens that you want Axis to behave the
other way and have nillable take priority.  I think you are in the
minority on this, but if you want to hack your copy of axis to prefer
the other way, you can.  If you would like to file an enhancement
request with a patch to make this configurable, that would be great too.

 

Thanks.

--
Tom Jordahl
Macromedia Server Development

________________________________

From: Jerry DuVal [mailto:jduval@pace2020.com] 
Sent: Friday, November 18, 2005 3:24 PM
To: axis-dev@ws.apache.org
Subject: losing placeholder when nillable="true" and minOccurs="0"
attributes on the same element 

 

Hello,

 

I posted this issue to the user list and received no responses.  Is this
a bug?

 

I'm having a issue related to using nillable="true" and minOccurs="0"
attributes on the same element.  When setting these elements to null the
placeholder for the element with xsi:nil="true" is only being sent when
the element does not have the minOccurs="0" .  I have a example included
below to display both the packet sent from axis and the same packet sent
using PHP 5.0 distributed SOAP.  Why does axis not sent the place holder
for promiseDate since it has the nillable="true" and the element was set
to null? Is this a bug?

 

//WSDL for updateJob service
<xsd:complexType name="Job">
<xsd:sequence>
<xsd:element name="promiseDate" nillable="true" minOccurs="0"
type="xsd:dateTime"/> 
<xsd:element name="dateSetup" nillable="true" type="xsd:dateTime"/>
</xsd:sequence>
</xsd:complexType>

//Java code for setting attributes for the service
job.setPromiseDate( null );
job.setDateSetup( null );

//Packet sent to Web Service 
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<updateJob xmlns="urn://pace2020.com/epace/sdk/UpdateObject">
<job>
<ns15:dateSetup xsi:nil="true"
xmlns:ns15="http://pace2020.com/epace/object"/>
</job>
</updateJob>
</soapenv:Body>
</soapenv:Envelope>

 

 

//PHP 5.0 distributed SOAP lib

// code for setting attributes for the service

$existingJob -> promiseDate = null;

$existingJob -> dateSetup = null;

 

//Packet sent to Web Service

<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<updateJob xmlns="urn://pace2020.com/epace/sdk/UpdateObject">
<job>

<ns15:promiseDate xsi:nil="true"
xmlns:ns15="http://pace2020.com/epace/object"/>
<ns15:dateSetup xsi:nil="true"
xmlns:ns15="http://pace2020.com/epace/object"/>
</job>
</updateJob>
</soapenv:Body>
</soapenv:Envelope>

 

 

Jerry DuVal
Pace Systems Group, Inc.
800.624.5999
www.Pace2020.com 

 


Mime
View raw message