tags:

views:

221

answers:

1

I'm using NUSOAP on the server-side of a web service. I want to return a null dateTime element, but I'm not sure how.

If I return the values false or '' , the result is

<due_date xsi:type="xsd:dateTime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/&gt;

whereas I would like it to be

<due_date xsi:type="xsd:dateTime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:null="true"/>

If I return null, the due_date tag is not present anymore, which causes problems on the client side.

A: 

Instead of null or '', explicitly return new soapval( 'element','xsd:dateTime', null ).

(Some) courtesy of the NuSOAP Sourceforge forums.

Robert Munteanu