
I'm currently communicating with an external SOAP service within AX using the a service reference and the generated .NET class. Everything is working out greatly with the exception of how to handle SOAP faults. Ideally, this doesn't happen, but sometimes the SOAP server (which I control as well) throws a SOAP fault with a "code" and a "message". Some examples of codes and their respective messages:
try
{
new InteropPermission(InteropKind::ClrInterop).assert();
// ... code making SOAP calls
CodeAccessPermission::revertAssert();
}
catch(Exception::CLRError)
{
warning(AifUtil::getClrErrorMessage());
}
This handles the SOAP fault well enough, the error it produces is the following: " Type 'System.ServiceModel.Channels.ReceivedFault' in assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable."
I have tried drilling down the base .NET classes, but the ServiceModel (and subsequently) the other classes for translating the SOAP fault into a human readable message are obscured.
Can anyone lend me some insight on how best to get at the actual fault code/message? Thanks!
*This post is locked for comments
I have the same question (0)