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

Suppressing xsi:nil=true in body of parameterless calls

Expand Messages
  • Klaus Guenter
    Hi List, I have to call a Webservice named GetManufacturers that does not accept any parameter. Unfortunately SOAP::LIte (0.714) generates
    Message 1 of 1 , Mar 13, 2012
    • 0 Attachment
      Hi List,

      I have to call a Webservice named GetManufacturers that does not accept any
      parameter.

      Unfortunately SOAP::LIte (0.714) generates <admin:GetManufacturers
      xsi:nil="true" /> instead of <admin:GetManufacturers/> in the SOAP Body, which
      is not accpetd by the SOAP server.

      All I found so far on the web is the hint to create my own serializer to solve
      this. I dont think this will solve my problem as I dont want to change the
      behaviour of SOAP::Lite with regard to serialization of an undefined parameter
      but rather want to skip the parameter serialization for parameterless method
      calls completely.

      After some UTSL I changed line 1593 in SOAP::LIte from

      $body->set_value($parameters ? \$parameters : SOAP::Utils::encode_data()) if
      $body;

      to

      $body->set_value($parameters, \$parameters) if $body && $parameters;

      which results in the "correct" body tag as described above.

      I would like to know if there is a better way to achieve this or if not,
      whether we could make this behaviour configuration dependend lets say over a
      method call like $handle->suppress_nils_in_parameterless_calls(1|0) as
      already implemented for calls like $handle->use_default_ns()

      Best regards,

      Klaus
      --
      Polymer physicists are into chains.
      -
    Your message has been successfully submitted and would be delivered to recipients shortly.