From: Vetrivel Vaithilingam Date: 2010-03-01T23:39:44+09:00 Subject: Re: SOAP::FaultError in Ruby wsdl Vetrivel Vaithilingam wrote: > Dear Friends , > I am using ruby wsdl . Using wsdl2ruby I have generated client > application . But the problem is that , I got the SOAP::FaultError if it > is any error . > > But the default.rb file has > class NardaFault > attr_accessor :errorCode > attr_accessos :errorString > > def initialize( errorCode , errorString) > end > end > If there is no error i am getting proper reponse . But if i get any > error from the server , > i am getting SOAP::FaultError only . But I need NardaFault Object , to > fetch the errorCode and errorString. > I have done one more thing also . > > rescue => e > puts e.inspect # SOAP::FaultError Object . > puts e.faultcode.to_s # I got SOAP::SOAPElement:0xb7cee264 > > My Question is that , > Whenever , error has come i need to rescue the error and i have to get > the errorCode and errorString . But Always i am getting SOAP::FaultError > only . > > Thanks for Advance ...... Sorry . I got the solution . The Solution is:- e.detail.fault.errorCode -- Posted via http://www.ruby-forum.com/.