on 07-28-2009 10:46 AM
After doing a SOAP lookup in a UDF I'd like to catch any possible exception and check if it's recoverable or not, to do a different treatment:
...
SystemAccessor accessor = LookupService.getSystemAccessor(channel);
...
Payload payload = accessor.call(payloadIn); // This is the call that may throw LookupException
Checking the API (http://help.sap.com/javadocs/pi/SP3/xpi/index.html?com/sap/aii/mapping/lookup/LookupException.html), I don't think that is possible to find out if the LookupException created automatically by PI is recoverable or not, which I find very strange.
Am I right?
Hi,
Please use try catch block and trace the Exception in the catchBlock.
try {
...
SystemAccessor accessor = LookupService.getSystemAccessor(channel);
...
Payload payload = accessor.call(payloadIn);
.....
} catch (LookupException e) {
trace.addWarning("Error during lookup - " + e);
}
https://wiki.sdn.sap.com/wiki/display/Snippets/User-definedMappingFunctionforRFC+Lookup
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jorge,
I see your problem now.
I think you are right when you said there are no java functions that would get the recoverable/not recoverable information.
YOu should probably raise an OSS and see what SAP says.
Did you try to use the getStackTrace() method to see if that information is embedded somewhere in between?
Regards,
Ravi
Hi,
Yes this is recoverable (as API said).
Use any of the constructor (From API):
LookupException(String message, boolean recoverable) : Constructs a new exception with the specified detail message and the specified recoverable attribute value.
LookupException(String message, Throwable cause, boolean recoverable) : Constructs a new exception with the specified detail message, cause, and the specified recoverable attribute value.
LookupException(Throwable cause, boolean recoverable): Constructs a new exception with the specified recoverable attribute value, the specified cause and a detail message of (cause==null ?
U can record recover the instances in the catch block in case of an exception and then recover later.
catch(Exception e)
{
LookupException le = new <constuctor u want to use>
// your code
}
Regards,
Gourav
Hi Jorge,
The document that you have provided, says that it does "adds an attribute which differs between a "recoverable" and permanent exception indicating whether it makes sense to repeat the previous lookup call."
Is it not something you are looking for?
I'm slightly confused with your question.
Can you rephrase your question?
Thanks and Regards,
ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ravi,
I have in my code the call to the SOAP lookup like this:
try{
...
Payload payload = accessor.call(payloadIn);
} catch (LookupException e) {
??
}
I'd like to check in ?? if the exception captured, e, is recoverable or not (for example, if the web service I'm calling is down, PI will create automatically a LookupException). But I don't seem to have in the API something like e.isRecoverable() or something similar.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.