简体   繁体   English

从aif Web服务捕获警告消息

[英]catching the warning message from aif web service

I have a aif service in ax 2012 . 我在ax 2012有一个aif服务。 I pass information into it from .net applications. 我从.net应用程序传递信息。 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. 但警告消息显示导致错误数据等错误的实际原因。

Is there a way to catch and display the warning message. 有没有办法捕获并显示警告消息。 I tried exception::warning but it just goes right to the exception::error . 我尝试了exception::warning但它只是正确的exception::error

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

I hope to understok the question. 我希望能够解决这个问题。

If you ant get all Warning message from Infolog, I have a little solution. 如果您从Infolog获得所有警告消息 ,我有一个小解决方案。 You can take all Infolog created by system, look like : 您可以使用系统创建的所有Infolog,如下所示:

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

It's not exactly request, but with this way can find all InfoLog displayed and warning too. 这不完全是请求,但通过这种方式可以找到所有InfoLog显示和警告。

Good Work. 干得好。

References : Infolog-INFO - Infolog2String 参考文献: Infolog-INFO - Infolog2String

从内存,但你尝试过:

throw error(AifUtil::getClrErrorMessage());

也许这可以帮助throw error(CLRInterop::getLastException().ToString());

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM