The PHP SOAP extension sends all fields that defined in
the generated files, regardless whether they are set to
null.
This can cause problems when the receiving webservice
is validating the request - eg. against a XSD where
this field is optional (minOccurs=0).
The attached patch extends the generated main php-file,
so that an array of additional options can be passed in
via the constructor.
Currently only one additional option is supported:
stripEmptyTags. This simply strips all empty tags
("<empty/>") from the request's SOAP body before
sending it. This option can be set to 'true' to enable
it or 'false' to disable it.
Usage (default URL):
$client = new YourGeneratedService(null,
array('stripEmptyTags' => true));
Usage (supplied URL):
$client = new
YourGeneratedService('http://yourwebservice',
array('stripEmptyTags' => true));
The patch also includes the fix for the constructor to
properly accept an URL.
Patched file: wsdl2php.php
extendedOptions.patch