Skip to Content
0
Former Member
Apr 13, 2010 at 01:18 PM

WD application getting exception's message of a CAF operation

26 Views

Hello,

I have the following CAF application services operation:

@com.sap.caf.dt.CAFOperation(name = "getSid")
public java.lang.String getSid(java.lang.Short letter, java.lang.String type)
		throws com.sap.caf.rt.exception.CAFRetrieveException {
	
	Sistema sis = this.getsistemaService().readByCustomKeys(letter, type);
	
	if (sis == null){
		return "Sid not found!";
	} else {
		return sis.getDescricao();
	}
}

and the following web dynpro application method:

public void executetesteAplicServiceServiceLocal_getSid( )  {
	//@@begin executetesteAplicServiceServiceLocal_getSid()
	//$$begin Service Controller01(1934885311)
	try
	{
	  wdContext.currentRequest_testeAplicServiceServiceLocal_getSidElement().modelObject().execute();
	  wdContext.nodeResponse_2().invalidate();
	}
	catch(EJBModelExecuteException e)
	{
	  wdComponentAPI.getMessageManager().reportException(e.getMessage());
	}

	//$$end
	//@@end
}

The WD application is using the CAF operation and when the CAF operation doesn't find the data it throws a CAFRetrieveException, but the message of this exception is not caught by the WD application because it's catching an EJBModelExecuteException. The message caught is always null.

I'd like to know how to get the exception's message that is throwable by the CAF application services?

Thanks.

Fabio