SOAP Exception

Hi,

When a external soap server throws a exception the client sees that exception and raises it.
But I want also the details of the exception.

The wsdl is processed successfully and there is some logic for this in the _intf file.

FaultErrorFault = class(EROException)
  private
    fFaultCode: ROUTF8String;
    f_FaultDetails: FaultDetails;
    fFaultString: ROUTF8String;
    function Get_FaultDetails: FaultDetails;
  protected
    property int__FaultDetails: FaultDetails read f_FaultDetails;
  public
    constructor Create(anExceptionMessage: String; aFaultCode: ROUTF8String; a_FaultDetails: FaultDetails; aFaultString: ROUTF8String);
    class function GetAttributeCount: Integer; override;
    class function GetAttributeName(aIndex: Integer): String; override;
    class function GetAttributeValue(aIndex: Integer): String; override;
    procedure Assign(aSource: EROException); override;
    procedure ReadException(aSerializer: TROBaseSerializer); override;
    procedure WriteException(aSerializer: TROBaseSerializer); override;
  published
    property FaultCode: ROUTF8String read fFaultCode write fFaultCode;
    property _FaultDetails: FaultDetails read Get_FaultDetails write f_FaultDetails;
    property FaultString: ROUTF8String read fFaultString write fFaultString;
  end;

How do I get this exception to work, so I can get the Faultcode and FaultDetails?

Hi,

something like

try
  MyMethod;
except
  on E: FaultErrorFault  do begin
    ShowMessage(E.FaultString);
  end;
  on E: Exception do raise;
end;

Hi,

I tried that but it only executes the normal exception.
Do I need to do something else?

Hi,

Can you create a simple testcase that reproduces this case, pls?
I’ll review what is wrong.

You can drop email to support@ for keeping privacy

Hi,

You can use OnSOAPFault event of TROSOAPMessage for inspecting the fault details

Thanks again Evgeny.