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

2401

Expand Messages
  • Collin Peters
    Feb 20 9:04 AM
    • 0 Attachment
      When I send a soap message via soap::lite, it seems to add lots of
      extraneous namespace information and stuff into the tag. My soap server
      doesn't seem to like this as it returns the faultcode
      "Server.WriteError" (faultstring: 'Database update failed') with the
      additional message: "Tuple is changed by other user". The full soap
      response is at the bottom of the message.

      If I strip this namespace and other information out, and send the
      message a different way(not via soap::lite), I don't get the error. So
      my question is: Is there a way to generate an XML message via
      SOAP::Lite without all the extra info in the tags?

      XML I want to generate:
      <tuple>
      <old>
      <WirelessCBOM>
      <Id>27</Id>
      </WirelessCBOM>
      </old>
      </tuple>

      XML generated by soaplite (from serializer output):
      <?xml version="1.0"?>
      <tuple xmlns="" xsi:type="namesp1:SOAPStruct">
      <old xsi:type="namesp1:SOAPStruct">
      <WirelessCBOM xsi:type="namesp1:SOAPStruct">
      <Id xsi:type="xsd:int">27</Id>
      </WirelessCBOM>
      </old>
      </tuple>

      Here is the code that generates the XML:
      my @selected = $q->param("ids");
      my @todelete = ();
      #delete the items
      foreach my $id (@selected) {
      my $tuple = {
      'tuple' => {
      'old' => {
      WirelessCBOM => {
      Id => $id
      }
      }
      }
      };
      my $a = SOAP::Data->name(%$tuple);
      push(@todelete,$a);
      }
      print SOAP::Serializer->serialize(@todelete);

      Here is the full SOAP response:
      <SOAP-ENV:Fault>
      <SOAP-ENV:faultcode>Server.WriteError</SOAP-ENV:faultcode>
      <SOAP-ENV:faultstring>Database update
      failed</SOAP-ENV:faultstring>
      <SOAP-ENV:detail>
      <tuple xmlns="" xsi:type="namesp3:SOAPStruct">
      <old xsi:type="namesp3:SOAPStruct">
      <WirelessCBOM xsi:type="namesp3:SOAPStruct">
      <Id>27</Id>
      </WirelessCBOM>
      </old>
      <error TYPE="Enumeration">
      <elem>Tuple is changed by other user</elem>
      </error>
      </tuple>
      </SOAP-ENV:detail>
      </SOAP-ENV:Fault>

      Regards,
      Collin Peters
    • Show all 4 messages in this topic