on 09-05-2005 3:43 PM
Hello,
I Call my Java Inbound Proxy and catch an exception.
How can i send now a Faul Message back to XI ?
} catch (Exception ex4) {
ExchangeFaultData_Type faultData = new ExchangeFaultData_Type();
faultData.setFaultText(ex4.getMessage());
ErrorReturn_Type errorReturn = new ErrorReturn_Type();
errorReturn.setStandard(faultData);
}
What should i do ?
Regards,
Robin
Hi Robin,
If you have specified the Fault Message in the Inbound Message Interface and have generated the proxy you will find in the *.template file that the Fault Message appears in the throws clause of the method.
So in your code you can just throw the Fault Message object.
Regards
Sidharth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
i throw it like:
} catch (Exception ex4) {
ExchangeFaultData_Type faultData = new ExchangeFaultData_Type();
faultData.setFaultText(ex4.getMessage());
ErrorReturn_Type errorReturn = new ErrorReturn_Type();
errorReturn.setStandard(faultData);
throw new ErrorReturn_Message_Exception();
}
but nothing happend... no message in monitoring.
it can't be so difficult to send a fault message with the exception or is it?
Hi Robin:
Without knowing your complete code, I think what your are missing is "gluining" everything together, something like this:
Somewhere in your code, define some variables:
...
ExchangeFaultData_Type faultData = null;
FmJpAviso_Type fmJpAviso_Type = null;
FmJpAviso_Message fmJpAviso_Message = null;
FmJpAviso_Message_Exception fmJpAviso_Message_Exception = null;
...
catch( HibernateException ehibernate )
{
mensajeError = new StringBuffer();
mensajeError.append(DataComercial.PED_XI_BDI_DMS_DC_001).append("\n\n")
.append(ehibernate.toString());
catAPPL.fatalT(logger,mensajeError.toString());
// Default Integration Scenario ExchangeFault Message
faultData = new ExchangeFaultData_Type();
faultData.setFaultText(mensajeError.toString());
// My Fault Message Type for the inbound Message Interface
fmJpAviso_Type = new FmJpAviso_Type();
fmJpAviso_Type.setStandard(faultData);
// My Fault Message
fmJpAviso_Message = new FmJpAviso_Message();
fmJpAviso_Message.setFmJpAviso(fmJpAviso_Type);
// My Fault Message Exception
fmJpAviso_Message_Exception = new FmJpAviso_Message_Exception();
fmJpAviso_Message_Exception.setFmJpAviso_Message(fmJpAviso_Message);
ehibernate = null;
mensajeError = null;
// Inform XI about this situation in the Java Proxy
throw fmJpAviso_Message_Exception;
}
Hope this helps,
Regards, Pedro
User | Count |
---|---|
85 | |
10 | |
9 | |
9 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.