Quantcast
Channel: Martin Dráb's Activities
Viewing all articles
Browse latest Browse all 17532

Get full WebResponse in case of error when calling webRequest.GetResponse();

$
0
0

AX 2012, I have this code that returns catches any error during a web request:

 try{
        httpWebResponse = webRequest.GetResponse();
    }
    catch (Exception::CLRError)
    {
         ex = ClrInterop::getLastException();
        if (ex != null)
         {
            ex = ex.get_InnerException();
            if (ex != null)
            {
                error(ex.ToString());
            }
        }
        return;
    }
/*
Also tried
catch(Exception::CLRError)
    {
        throw error(AifUtil::getClrErrorMessage());
    }

*/


So this is working OK, but I'm justing getting something generic like "server returned error 500"

Is there any way I can get the full XML Response from the web service I'm calling. The thing is that the exact detailed error will be in the full response body.

Any ideas?


Viewing all articles
Browse latest Browse all 17532

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>