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

Re: [soaplite] Error Retrieving Soap Fault

Expand Messages
  • Duncan Cameron
    ... When using the service() approach, the result of your createFault() is not a SOM object, it really is the result of your call. So you can t call the
    Message 1 of 3 , Dec 18, 2002
    • 0 Attachment
      On 2002-12-18 Nate Bowler <nate_bowler wrote:
      >I'm calling a test function that creates a SOAP Fault. The server is
      >implemented in Java. However, when I call this method, $result is
      >undefined, so my check to $result->fault fails.
      >
      >Does anybody know what is going on here?
      >
      >I've attached my Perl code and the XML response below:
      >
      >#!perl -w
      >#!d:\perl\bin\perl.exe
      >use SOAP::Lite;
      >
      >my $attask_tns = 'http://www.attask.com/api';
      >
      >my $api_server = SOAP::Lite
      > -> soapversion(1.2)
      > -> uri('http://www.attask.com/api')
      > -> service('http://localhost:8081/attask/APIService.wsdl');
      >
      >##################################################
      ># login
      >my $sessionID = $api_server->login("admin","user");
      >
      >##################################################
      ># call createFault
      >$result = $api_server->createFault(1);
      >
      >if( $result->fault ){
      > print "In here!!\n";
      >}
      >
      >##################################################
      ># logout
      >$api_server->logout($sessionID);
      >
      >
      When using the service() approach, the result of your createFault()
      is not a SOM object, it really is the result of your call. So you
      can't call the fault() method on it, nor the result() method either.
      To get the flexibility you want you need to specify the proxy and
      uri directly.


      Regards,
      Duncan Cameron
    • Paul Kulchenko
      Hi Duncan, ... While that s correct you can still access this information using ... $r = $api_server- call(); # call() without parameters returns the result of
      Message 2 of 3 , Dec 18, 2002
      • 0 Attachment
        Hi Duncan,

        > When using the service() approach, the result of your createFault()
        > is not a SOM object, it really is the result of your call. So you
        While that's correct you can still access this information using
        call() method:

        > >$result = $api_server->createFault(1);

        $r = $api_server->call(); # call() without parameters returns the
        result of the last call

        die $r->faultstring if $r->fault;

        > >my $api_server = SOAP::Lite
        > > -> soapversion(1.2)
        soapversion() call shouldn't be made at run-time (this syntax will be
        disallowed in the future). The correct usage is this:

        use SOAP::Lite soapversion => 1.2;

        Best wishes, Paul.

        --- Duncan Cameron <dcameron@...> wrote:
        > On 2002-12-18 Nate Bowler <nate_bowler wrote:
        > >I'm calling a test function that creates a SOAP Fault. The server
        > is
        > >implemented in Java. However, when I call this method, $result is
        > >undefined, so my check to $result->fault fails.
        > >
        > >Does anybody know what is going on here?
        > >
        > >I've attached my Perl code and the XML response below:
        > >
        > >#!perl -w
        > >#!d:\perl\bin\perl.exe
        > >use SOAP::Lite;
        > >
        > >my $attask_tns = 'http://www.attask.com/api';
        > >
        > >my $api_server = SOAP::Lite
        > > -> soapversion(1.2)
        > > -> uri('http://www.attask.com/api')
        > > -> service('http://localhost:8081/attask/APIService.wsdl');
        > >
        > >##################################################
        > ># login
        > >my $sessionID = $api_server->login("admin","user");
        > >
        > >##################################################
        > ># call createFault
        > >$result = $api_server->createFault(1);
        > >
        > >if( $result->fault ){
        > > print "In here!!\n";
        > >}
        > >
        > >##################################################
        > ># logout
        > >$api_server->logout($sessionID);
        > >
        > >
        > When using the service() approach, the result of your createFault()
        >
        > is not a SOM object, it really is the result of your call. So you
        > can't call the fault() method on it, nor the result() method
        > either.
        > To get the flexibility you want you need to specify the proxy and
        > uri directly.
        >
        >
        > Regards,
        > Duncan Cameron
        >
        >
        >
        >
        >
        >
        > ------------------------ Yahoo! Groups Sponsor
        >
        > To unsubscribe from this group, send an email to:
        > soaplite-unsubscribe@yahoogroups.com
        >
        >
        >
        > Your use of Yahoo! Groups is subject to
        > http://docs.yahoo.com/info/terms/
        >
        >


        __________________________________________________
        Do you Yahoo!?
        Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
        http://mailplus.yahoo.com
      Your message has been successfully submitted and would be delivered to recipients shortly.