http://qs321.pair.com?node_id=931103

ptum has asked for the wisdom of the Perl Monks concerning the following question:

I'm using SOAP::Lite in a client which consumes a SOAP service over which I have no control. Traditionally, I've used code like this:

my $response; eval { $response = $soap_handle->call('MyMethod', $security_token, $datagra +m); }}; if ($@) { print "Error: SOAP call died: $@. \n"; }

When the method doesn't call for any arguments, I just pass undef in $datagram, and it worked just fine, producing XML like this:

<?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope blah blah blah> <soapenv:Header> <wsse:Security blah><blah>blah</blah></wsse:Security> </soapenv:Header> <soapenv:Body> <MyMethod xsi:nil="true" /> </soapenv:Body> </soapenv:Envelope>

Recently, the vendor has updated their web service, and they no longer accept the xsi:nil="true" attribute.

How can I suppress that nil attribute using SOAP::Lite, so that my tag looks more like this?

<soapenv:Body> <MyMethod/> </soapenv:Body>

No good deed goes unpunished. -- (attributed to) Oscar Wilde