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

3644RE: [soaplite] Quick question -- Simple Fault handling

Expand Messages
  • Mitchell, Louise M
    Jun 4, 2004
    • 0 Attachment
      if ($response->fault)
      {
      die $response->faultstring;
      }
      else
      {
      my $result = $response->result;
      return $result;
      #my %result = %{$response->result};
      #print map("$_: @{[$result{$_} || '']}\n", keys %result), "\n";
      }

      -----Original Message-----
      From: chenlyc7 [mailto:chenl@...]
      Sent: Friday, June 04, 2004 11:08 AM
      To: soaplite@yahoogroups.com
      Subject: [soaplite] Quick question -- Simple Fault handling


      Hi,
      I'm trying to get our perl client to handle a very simple Fault
      message from the server that has the following format:


      <?xml version="1.0" encoding="UTF-8"?>
      <soapenv:Envelope
      xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soapenv:Body>
      <soapenv:Fault>
      <faultcode>soapenv:Server.generalException</faultcode>
      <faultstring>A sample fault message here...</faultstring>
      <detail>
      <string>A sample fault message here...</string>
      </detail>
      </soapenv:Fault>
      </soapenv:Body>
      </soapenv:Envelope>

      how would one be able to retrieve the strings in faultstring and detail
      tags if the hypothetical client had the following code:

      $soap_response= SOAP::Lite
      -> uri('<URI of the service>')
      -> proxy('http://address_here')
      -> methodName(SOAP::Data->name(arg0 => \@arg0stuff),
      SOAP::Data->name(arg1 => \@arg1stuff), SOAP::Data->name(arg2
      =>\@arg2stuff))
      -> result;

      ? I am new to this and would like to quickly setup an example for perl
      to handle simple faults as described above.

      Thanks in advance!





      Yahoo! Groups Links
    • Show all 7 messages in this topic