Loading ...
Sorry, an error occurred while loading the content.

How to suppress xsi:nil attributes in method calls with no parameters?

Expand Messages
  • aisipos
    I m trying to use SOAP::Lite to write a client to a .NET Web Service in document/literal style. I ve got everything working except for methods that take no
    Message 1 of 1 , Apr 5, 2006
    • 0 Attachment
      I'm trying to use SOAP::Lite to write a client to a .NET Web Service
      in document/literal style. I've got everything working except for
      methods that take no parameters. I'm initializing SOAP::Lite as follows:

      my $soap = SOAP::Lite
      -> uri('http://myuri.com')
      -> on_action(sub{join '/', 'http://myuri.com' , $_[1]})
      -> proxy('https://myserver/service.asmx')
      -> encodingStyle(undef);

      I'm trying to call a method with no arguments as follows:

      my $result = $soap->call(name('NoArgMethod'))->result;


      Which produces the following SOAP body (the envelope is ok):
      <soap:Body><GetCustomerInfo xsi:nil="true" /></soap:Body>

      The .NET Web Service doesn't like this, it returns a fault:
      'If the 'nillable' attribute is false in the schema, then the
      'xsi:nil' attribute must not be present in the instance'

      I may be able to fix this on the server, however is there a relatively
      easy way to get SOAP::Lite to suppress the xsi:nil attribute? I'm
      pretty sure I can do this by creating a custom serializer, but is
      there an easier way?

      Thanks in advance for any help!
      --Anton
    Your message has been successfully submitted and would be delivered to recipients shortly.