title: SOAP - nillable="true"
body: <p>I am building a web service using the Zend Framework. I am using the Zend_Soap_AutoDiscover class for the generation of my WSDL. I am using various complex type in this web service form example:</p>
  
  <p><strong>StockItemEntity Class</strong></p>
  
  <pre><code>class StockItemEntity {
      /** @var string */
      public $sStockCode;
      /** @var string */
      public $sQty;
  
      public function __construct($sStockCode, $sQty){
          $this-&gt;sStockCode = $sStockCode;
          $this-&gt;sQty = $sQty;
      }   
  }
  </code></pre>
  
  <p><strong>WSDL Definition</strong> </p>
  
  <pre><code>&lt;xsd:complexType name="StockItemEntity"&gt;
    &lt;xsd:all&gt;
      &lt;xsd:element name="sStockCode" type="xsd:string" nillable="true"/&gt;
      &lt;xsd:element name="sQty" type="xsd:string" nillable="true"/&gt;
    &lt;/xsd:all&gt;
  &lt;/xsd:complexType&gt;
  </code></pre>
  
  <p>From what I understood from reading over the web the nillable="true" is there because properties of any object can be set to null. Thus the nillable="true" is need to maintain a valid XML document even if the StockItemEntity object has all its properties set to null.</p>
  
  <p>My concern is that those two properties must always be passed to the web method. Is it possible to remove the "nillable=true" to sort of force the properties not to be null? Or else is there any way to force non null values in those properties. I was hoping to avoid having to validate them on the webservice side.</p>
  
  <p>Thanks</p>
  
  <p>Kind Regards</p>
  
  <p>Gabriel</p>