SOAP::FaultError in Ruby wsdl

  • Thread starter Vetrivel Vaithilingam
  • Start date
V

Vetrivel Vaithilingam

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 ......
 
V

Vetrivel Vaithilingam

Vetrivel said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,161
Latest member
GertrudeMa
Top