从aif Web服务捕获警告消息 [英] catching the warning message from aif web service

查看:93
本文介绍了从aif Web服务捕获警告消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 ax 2012 中提供aif服务.我从.net应用程序将信息传递给它.基本上,我要发布到一般杂志上.但是,如果发生错误(例如,传递了错误的信息),则通常会返回一般错误,错误验证记录" .但是警告消息显示了导致错误(例如数据错误)的实际原因.

I have a aif service in ax 2012. I pass information into it from .net applications. basically i'm posting to the general journal. But when there is an error, say bad information being passed in, it returns a general error usually "error validating record". But the warning message displays the actual reason why it caused an error such as the bad data.

是否可以捕获并显示警告消息.我尝试了exception::warning,但它恰好进入了exception::error.

Is there a way to catch and display the warning message. I tried exception::warning but it just goes right to the exception::error.

catch (Exception::Error)
{
    throw Global::error("need to get warning");
}

推荐答案

我希望理解这个问题.

如果您从Infolog获得了所有警告消息,我有一个解决方案. 您可以使用系统创建的所有Infolog,如下所示:

If you ant get all Warning message from Infolog, I have a little solution. You can take all Infolog created by system, look like :

InfologData             msg;
catch (Exception::Error)
{
     msg = infolog.infologData();
     infolog.import(msg); // HERE show all infolog - with INFO - Warning - Errors
     throw Global::error("Process Error");
}

这并非完全是请求,但是通过这种方式也可以找到所有显示的InfoLog并发出警告.

It's not exactly request, but with this way can find all InfoLog displayed and warning too.

干得好.

参考文献: Infolog-信息- Infolog2String

这篇关于从aif Web服务捕获警告消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆