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

4839Re: [soaplite] catching SOAP faults

Expand Messages
  • Duncan Cameron
    Aug 10, 2005
    • 0 Attachment
      On 2005-08-10 at 00:49:33 Chris wrote:

      > I have a Java axis webservice I am trying to call from perl.
      >Everything works fine as long as the proper things are passed and
      >everything is okay. However, I have a method, that takes an array of
      >elements which needs to be event. If it is not, the method returns a
      >SOAPFAULTException which should produce a soap fault. The method
      >does not return any arguments so there is not return value (it returns
      >a undef in perl just to make sure). But if I pass it an odd # of
      >aruments, the method just silently returns nothing and it goes on.
      >If I turn trace on, I can see that the method actually fails with
      >SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal
      >Server Error
      >and then I see the return fault from the service:
      ><?xml version="1.0" encoding="UTF-8"?>
      > <soapenv:Body>
      > <soapenv:Fault>
      > <faultcode>soapenv:Server.userException</faultcode>
      > <faultstring>javax.xml.rpc.soap.SOAPFaultException: create_event
      >failed: Arguments must be key value pairs, not an even number of
      > <detail/>
      > </soapenv:Fault>
      > </soapenv:Body>
      >SOAP::Transport::HTTP::Client::send_receive: POST
      >Accept: text/xml
      >Accept: multipart/*
      >Content-Length: 688
      >Content-Type: text/xml; charset=utf-8
      >SOAPAction: ""
      >In addition, if the webserver return any fault to any method, it is
      >quietly ignored. How can I get back the faults in perl SOAP::Lite?
      >Since the return value is undef, I cannot look at $ret->fault, or
      >anyting like that?

      That us exactly what you do look at.

      my $som = $soap->some_method();

      if ($som->fault) {
      print $som->faultcode;
      } else {
      # it worked
      print $som->result;


      Duncan Cameron
    • Show all 3 messages in this topic