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

When is a fault not a fault?

Expand Messages
  • BC
    Under certain circumstances SOAP::Lite is receiving valuable fault information from the server, but I can t figure out how to cleanly retrieve it. Consider
    Message 1 of 7 , Jul 8, 2013
    • 0 Attachment
      Under certain circumstances SOAP::Lite is receiving valuable
      fault information from the server, but I can't figure out how to
      cleanly retrieve it. Consider the following example.

      - - - - - - - - - - - - - - - - - -

      use warnings;
      use strict;
      use SOAP::Lite;

      my $sObj = SOAP::Lite->new(uri => $NAME_SPACE, proxy => $END_POINT );
      my $rObj;
      eval
      {
      $rObj = $sObj->fooBar(); # line 29
      };

      warn("? $0: no SOAP::SOM object returned\n_ ") # line 32
      if (not defined($rObj));

      if ($@) # the eval didn't go well.
      {
      warn($sObj->transport->http_response->content()); # line 37
      warn("? $0: $@");
      warn("? $0: ", $sObj->transport->status(), "\n_ "); # line 39
      warn("? $0: ", $sObj->faultstring(), "\n_ "); # line 40
      }

      warn(" $0: reached end-of-script\n_ "); # line 43

      - - - - - - - - - - - - - - - - - -

      When we run this we get the following output:

      - - - - - - - - - - - - - - - - - -

      ? ./demo4: no SOAP::SOM object returned
      _ at ./demo4 line 32.
      <?xml version='1.0' ...<faultstring>Cannot find dispatch method ...
      at ./demo4 line 37.
      ? ./demo4: 500 Internal Server Error at ./demo4 line 29
      ? ./demo4: 500 Internal Server Error
      _ at ./demo4 line 39.
      500 Internal Server Error at ./demo4 line 40

      - - - - - - - - - - - - - - - - - -

      So this appears as if this is being treated as a transport error,
      unhelpfully reported as an "Internal Server Error", but there is
      a SOAP message that was returned in the response with the very
      helpful message:

      Cannot find dispatch method for {https://whatever}fooBar

      So I don't understand, using SOAP::Lite methods, how I should be
      capturing this return result.

      Here's an edited version of the return envelope...

      - - - - - - - - - - - - - - - - - -

      <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
      <S:Header>
      <work:WorkContext xmlns:work="http://oracle.com/weblogic/soap/workarea/">
      rO...AAA
      </work:WorkContext>
      </S:Header>
      <S:Body>
      <S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope">
      <faultcode>S:Client</faultcode>
      <faultstring>Cannot find dispatch method for
      {https://whatever/identity}fooBar
      </faultstring>
      </S:Fault>
      </S:Body>
      </S:Envelope>

      - - - - - - - - - - - - - - - - - -

      ...BC
    • Mithun Bhattacharya
      http://guide.soaplite.com/#error handling Seems to cover your specific scenario. ... http://guide.soaplite.com/#error handling Seems to cover your specific
      Message 2 of 7 , Jul 8, 2013
      • 0 Attachment

        Seems to cover your specific scenario.

        From: BC <Bill.Costa@...>
        To: soaplite@yahoogroups.com
        Sent: Monday, July 8, 2013 11:40 AM
        Subject: [soaplite] When is a fault not a fault?

        Under certain circumstances SOAP::Lite is receiving valuable
        fault information from the server, but I can't figure out how to
        cleanly retrieve it.  Consider the following example.
      • Michael Brader
        No it doesn t. In Bill s test case the returned object is undefined, so the code examples in that link will raise an exception. on_fault handlers will not run.
        Message 3 of 7 , Jul 8, 2013
        • 0 Attachment
          No it doesn't. In Bill's test case the returned object is undefined, so the code examples in that link will raise an exception. on_fault handlers will not run.

          This appears to be https://rt.cpan.org/Public/Bug/Display.html?id=85713

          The bug was marked resolved 26th June so it should be in the Github repo: https://github.com/redhotpenguin/soaplite but I haven't had the chance to verify yet.

          If anybody missed it, the move to Github is announced here: http://blogs.perl.org/users/phred/2013/07/the-state-of-soaplite---here-comes-10.html

          Cheers,
          Michael

          On 07/09/2013 03:00 AM, Mithun Bhattacharya wrote:
           

          Seems to cover your specific scenario.

          From: BC <Bill.Costa@...>
          To: soaplite@yahoogroups.com
          Sent: Monday, July 8, 2013 11:40 AM
          Subject: [soaplite] When is a fault not a fault?

          Under certain circumstances SOAP::Lite is receiving valuable
          fault information from the server, but I can't figure out how to
          cleanly retrieve it.  Consider the following example.

          -- 
          Michael Brader                    Senior Software Engineer and Perl Person
          Our World Wide Web has a World Wide Network      Technology/Softdev/DevOps
          Internode       http://internode.on.net/          mbrader@...
          iiNet             http://iinet.net.au/         m.brader@...
          
        • Andrew Hicox
          Wow, I did miss that. Is SOAP::Lite going to continue to be on CPAN, or ... ??? This blog post indicates a 1.0 version. CPAN still has 0.716. is the github
          Message 4 of 7 , Jul 9, 2013
          • 0 Attachment

            Wow, I did miss that.
            Is SOAP::Lite going to continue to be on CPAN, or ... ???

            This blog post indicates a 1.0 version. CPAN still has 0.716.

            is the github code considered "pre-release" or something ?

            -Andy

            On Jul 8, 2013, at 8:20 PM, Michael Brader wrote:

            If anybody missed it, the move to Github is announced here: http://blogs.perl.org/users/phred/2013/07/the-state-of-soaplite---here-comes-10.html

          • Michael Brader
            Many (most) CPAN modules host their source on github so I doubt it will be disappearing from CPAN. I don t know anything beyond what s in the blog post which I
            Message 5 of 7 , Jul 9, 2013
            • 0 Attachment
              Many (most) CPAN modules host their source on github so I doubt it will be disappearing from CPAN. I don't know anything beyond what's in the blog post which I found via PerlWeekly (http://perlweekly.com/).

              Cheers,
              Michael

              On 07/10/2013 02:11 AM, Andrew Hicox wrote:
               

              Wow, I did miss that.
              Is SOAP::Lite going to continue to be on CPAN, or ... ???

              This blog post indicates a 1.0 version. CPAN still has 0.716.

              is the github code considered "pre-release" or something ?

              -Andy

              On Jul 8, 2013, at 8:20 PM, Michael Brader wrote:

              If anybody missed it, the move to Github is announced here: http://blogs.perl.org/users/phred/2013/07/the-state-of-soaplite---here-comes-10.html


              -- 
              Michael Brader                    Senior Software Engineer and Perl Person
              Our World Wide Web has a World Wide Network      Technology/Softdev/DevOps
              Internode       http://internode.on.net/          mbrader@...
              iiNet             http://iinet.net.au/         m.brader@...
              
            • Michael Brader
              I spoke unclearly here so I should correct myself. I am not suggesting that any modules are no longer being hosted on CPAN, just that some module authors are
              Message 6 of 7 , Jul 10, 2013
              • 0 Attachment
                I spoke unclearly here so I should correct myself.

                I am not suggesting that any modules are no longer being hosted on CPAN, just that some module authors are using git and sometimes github to manage version control

                You can determine where (if anywhere) an author is hosting code additionally to CPAN by looking for repository links on the metacpan search engine.

                For example, https://metacpan.org/module/SOAP::Lite shows the Sourceforge svn repository where SOAP::Lite has lived until now.

                Cheers,
                Michael

                On 07/10/2013 10:01 AM, Michael Brader wrote:
                 

                Many (most) CPAN modules host their source on github so I doubt it will be disappearing from CPAN. I don't know anything beyond what's in the blog post which I found via PerlWeekly (http://perlweekly.com/).

                Cheers,
                Michael

                On 07/10/2013 02:11 AM, Andrew Hicox wrote:
                 

                Wow, I did miss that.
                Is SOAP::Lite going to continue to be on CPAN, or ... ???

                This blog post indicates a 1.0 version. CPAN still has 0.716.

                is the github code considered "pre-release" or something ?

                -Andy

                On Jul 8, 2013, at 8:20 PM, Michael Brader wrote:

                If anybody missed it, the move to Github is announced here: http://blogs.perl.org/users/phred/2013/07/the-state-of-soaplite---here-comes-10.html


                -- 
                Michael Brader                    Senior Software Engineer and Perl Person
                Our World Wide Web has a World Wide Network      Technology/Softdev/DevOps
                Internode       http://internode.on.net/          mbrader@...
                iiNet             http://iinet.net.au/         m.brader@...
                

                -- 
                Michael Brader                    Senior Software Engineer and Perl Person
                Our World Wide Web has a World Wide Network      Technology/Softdev/DevOps
                Internode       http://internode.on.net/          mbrader@...
                iiNet             http://iinet.net.au/         m.brader@...
                
            • bill.costa_01
              Thanks to everybody for your help on this. I asked my Sys Admin to install v1.0 today, but unfortunately that did not solve the problem. I can get the
              Message 7 of 7 , Jul 25, 2013
              • 0 Attachment
                Thanks to everybody for your help on this. I asked my Sys Admin to install v1.0 today, but unfortunately that did not solve the problem. I can get the service to work when there is no fault, but so far, for the faults I've been generating, the SOAP::SOM object is not defined and an exception is thrown...

                SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Server Error

                ...but an envelope is indeed returned and it contains the fault. What's the next step -- report it as a bug?
              • Your message has been successfully submitted and would be delivered to recipients shortly.