最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

How to get meaningful AIF messages on Web service consumer?

网络文摘 William 2673浏览 0评论

Sometime on your consumer code you don’t know the cause of error and you have to dig into it by looking at exception form with in AX. Although there is a way to get all the meaningful messages at your consumer end also.

Obviously “Include exception in fault” checkbox needs to be enabled on your inbound port.

inbound
After that small piece of code (Catch) block will help you to get the meaningful messages.

catch (System.ServiceModel.FaultException<AxIntegrationServiceRefCust.AifFault> aiffaultException)
            {
                AxIntegrationServiceRefCust.InfologMessage[] list = aiffaultException.Detail.InfologMessageList;

                foreach(AxIntegrationServiceRefCust.InfologMessage message in list)
                {
                    Console.WriteLine(message.Message);
                }

                return 0;
            }


发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址