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

Handling faults generated by Microsoft SOAP beta2 Toolkit

Expand Messages
  • software@einternet-studios.com
    I am having difficulty handling faults returned from a SOAP server/COM implementation built using Microsoft s SOAP SDK 2.0, beta 2. Here is my perl code, use
    Message 1 of 2 , Mar 23 9:49 AM
    • 0 Attachment
      I am having difficulty handling faults returned from a SOAP
      server/COM implementation built using Microsoft's SOAP SDK 2.0, beta
      2.

      Here is my perl code,

      use SOAP::Lite;

      my $soapCall = SOAP::Lite
      ->schema('http://cis-nt01.tamu.edu/soapwebservice/getaddress.wsdl');

      my $Result=$soapCall->GetAddress("456887741", "18950225");


      This call returns a fault, and when I try to print it using

      print $Result->faultstring;

      I get a error:
      Can't call method "faultstring" on an undefined value. . .


      When I run the trace, this is the response I get from my soap server:

      SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH
      (0x6826cc)
      SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal
      Server Error
      Cache-Control: private
      Date: Fri, 23 Mar 2001 17:38:55 GMT
      Server: Microsoft-IIS/4.0
      Content-Type: text/xml
      Client-Date: Fri, 23 Mar 2001 17:48:14 GMT
      Client-Peer: 128.194.103.94:80
      Set-Cookie: ASPSESSIONIDQGGQQHWE=DJBEIODDINJAFILCFKIMCCHJ; path=/

      <?xml version="1.0" encoding="UTF-8" standalone="no"?><SOAP-
      ENV:Envelope SOAP-EN
      V:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:SOAP-ENV="http
      ://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-
      ENV:Fault><faultcode
      >SOAP-ENV:Server</faultcode><faultstring>EntireXBroker: Error - you
      must enter a
      student ID that is nine numeric digits. Please re-enter.


      </faultstring><faultactor>http://tempuri.org/action/GetEntireXDa
      ta.GetAddress</faultactor><detail><mserror:errorInfo
      xmlns:mserror="http://schem
      as.microsoft.com/soap-
      toolkit/faultdetail/error/"><mserror:returnCode>-214681828
      3</mserror:returnCode><mserror:callStack><mserror:callElement><mserror
      :component
      >EntireXBroker</mserror:component><mserror:description>Error - you
      must enter a
      student ID that is nine numeric digits. Please re-enter.

      </mserror:description><mserror:returnCode>-
      2146818283</mserror:re
      turnCode></mserror:callElement><mserror:callElement><mserror:component
      >WSDLOpera
      tion</mserror:component><mserror:description>Executing method
      GetAddress failed<
      /mserror:description><mserror:returnCode>-
      2147352567</mserror:returnCode></mserr
      or:callElement></mserror:callStack></mserror:errorInfo></detail></SOAP
      -ENV:Fault
      ></SOAP-ENV:Body></SOAP-ENV:Envelope>

      How can I get the faultstring, so that I can trap this error. . .
    • Paul Kulchenko
      Hi, software@einternet-studios.com! The actualy code is: print $Result- call- faultstring; - call() method without parameters gives you access to last
      Message 2 of 2 , Mar 27 9:05 AM
      • 0 Attachment
        Hi, software@...!

        The actualy code is:

        print $Result->call->faultstring;

        ->call() method without parameters gives you access to last
        succesfull call. Next version will save value there regardless of
        success/unsuccess of the call, so you'll be able to get access to
        fault information also. Meantime you my assign on_fault() handler and
        handle faults there.

        Best wishes, Paul.

        --- software@... wrote:
        > I am having difficulty handling faults returned from a SOAP
        > server/COM implementation built using Microsoft's SOAP SDK 2.0,
        > beta
        > 2.
        >
        > Here is my perl code,
        >
        > use SOAP::Lite;
        >
        > my $soapCall = SOAP::Lite
        >
        >
        ->schema('http://cis-nt01.tamu.edu/soapwebservice/getaddress.wsdl');
        >
        > my $Result=$soapCall->GetAddress("456887741", "18950225");
        >
        >
        > This call returns a fault, and when I try to print it using
        >
        > print $Result->faultstring;
        >
        > I get a error:
        > Can't call method "faultstring" on an undefined value. . .
        >
        >
        > When I run the trace, this is the response I get from my soap
        > server:
        >
        > SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH
        > (0x6826cc)
        > SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal
        > Server Error
        > Cache-Control: private
        > Date: Fri, 23 Mar 2001 17:38:55 GMT
        > Server: Microsoft-IIS/4.0
        > Content-Type: text/xml
        > Client-Date: Fri, 23 Mar 2001 17:48:14 GMT
        > Client-Peer: 128.194.103.94:80
        > Set-Cookie: ASPSESSIONIDQGGQQHWE=DJBEIODDINJAFILCFKIMCCHJ; path=/
        >
        > <?xml version="1.0" encoding="UTF-8" standalone="no"?><SOAP-
        > ENV:Envelope SOAP-EN
        > V:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
        > xmlns:SOAP-ENV="http
        > ://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-
        > ENV:Fault><faultcode
        > >SOAP-ENV:Server</faultcode><faultstring>EntireXBroker: Error - you
        >
        > must enter a
        > student ID that is nine numeric digits. Please re-enter.
        >
        >
        > </faultstring><faultactor>http://tempuri.org/action/GetEntireXDa
        > ta.GetAddress</faultactor><detail><mserror:errorInfo
        > xmlns:mserror="http://schem
        > as.microsoft.com/soap-
        > toolkit/faultdetail/error/"><mserror:returnCode>-214681828
        >
        3</mserror:returnCode><mserror:callStack><mserror:callElement><mserror
        > :component
        > >EntireXBroker</mserror:component><mserror:description>Error - you
        > must enter a
        > student ID that is nine numeric digits. Please re-enter.
        >
        > </mserror:description><mserror:returnCode>-
        > 2146818283</mserror:re
        >
        turnCode></mserror:callElement><mserror:callElement><mserror:component
        > >WSDLOpera
        > tion</mserror:component><mserror:description>Executing method
        > GetAddress failed<
        > /mserror:description><mserror:returnCode>-
        > 2147352567</mserror:returnCode></mserr
        >
        or:callElement></mserror:callStack></mserror:errorInfo></detail></SOAP
        > -ENV:Fault
        > ></SOAP-ENV:Body></SOAP-ENV:Envelope>
        >
        > How can I get the faultstring, so that I can trap this error. . .
        >
        >
        >
        >
        >
        > ------------------------ 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! Auctions - Buy the things you want at great prices.
        http://auctions.yahoo.com/
      Your message has been successfully submitted and would be delivered to recipients shortly.