Setting up AX 2012 Reporting involves installing SQL Reporting Services and registering that Reporting Services installation in AX. One of the issues we were having is that we were seeing some problems deploying reports. In order to troubleshoot we tried the Test-AxReportServerConfiguration cmdlet.

In words: Exception has been thrown by the target of an invocation. The SQL Server Reporting Services server name RPRTAX1B.contoso.com does not exist or the Web service URL is not valid.

As it kept complaining about the URL I started to suspect what could be the root cause. From earlier experiences (Dynamics Ax 2012: Error Installing Enterprise Portal) I know that not all AX components can properly handle host headers. Because this is how our SQL Reporting Services host header configuration looks like for the Report Server URL:

Jup, we got multiple entries. The reason is somehow historical and not relevant here. It seems that AX, when validating the settings, checks whether the Report Server URL matches with the first host header in the SQL Reporting Services configuration. So I went ahead, removed all entries but the good one, ok-ed and applied. After that I re-added them. This ensured the URL AX knows of was on top of the list. And jup, everything started working!

A colleague from the AX team showed me which code was performing this check. Here’s the offending code:

// We must trap CLRError explicitly, to be able to retrieve the CLR exception later (using CLRInterop::getLastException() )

SRSProxy::handleClrException(Exception::Error);

result = false;

}

return result;

}

And that’s how I come to part two. When creating Report Server configurations within AX, one might be wondering how to register a load balanced Reporting Services setup…

Here’s the configuration extract of the server name & URLs for such a configuration. Now how do we handle the fact that there’s 2 Servers and one (virtual) load balanced URL?

In a load balanced setup with 2 reporting servers you’ll typically have 3 configurations FOR EACH AOS instance:

RSServerA(Default Configuration: unchecked)

Server name: ServerA

Report Manager URL: axreports.contoso.com/reports

Web service URL: axreports.contoso.com/reportserver

RSServer B (Default Configuration: unchecked)

Server name: ServerA

Report Manager URL: axreports.contoso.com/reports

Web service URL: axreports.contoso.com/reportserver

RSVirtualServer (the Load Balancer) (Default Configuration: checked)

Server name: ServerA

Report Manager URL: axreports.contoso.com/reports

Web service URL: axreports.contoso.com/reportserver

Now the clue is in the server name: this is the name which is being used to contact the actual Windows server for certain information. Like in the code above, the server will be contacted over WMI to read the requested setting. If you were to enter “axreports.contoso.com” as a servername, you’ll be seeing all kinds of errors. For starters typically your load balancer only balances port 80 or 443, but WMI uses other ports. So these connections will fail. As far as I learned from my AX colleague, the AOS instance can use the load balancer configuration entry, and you can use the node configuration for your report deployments. In that way, the server name probably doesn’t matter that much on the load balancer configuration item.

I hope I don’t sound to cryptically, if you like any further explanation, feel free to comment.

Hi, I encounter nearly the same problem.. When i just start AX 2012 R2, the system take longer time than usual. Then, POP! Error msg "Exception has been thrown by the target of an invocation" appeared..It happens randomly.. Realy frustating, because i have to close AX and wait for some minutes. Then, sometimes i can start AX again without problemAny idea, whats goin wrong?

When using Load Balanced scenario, if entering the Windows servername as ReportServer, and load balanced name as ReportServerURL, and WebServiceURL then all Validates ok, but if using load balanced name as ReportServer name, as you suggested, then it fails with "SQL Server Reporintg Services server name does not exist" - but surely this is not a valid test - what if that server happens to be offline? What'll happen to reporting?

For starters I would say: configure it that way and shut down your serverA. See what happens and learn from it :) My guess would be that reporting as it is would be unaffected. What I can imagine is that deploying new reports using AX utilities might fail. That's all I think.

Rendering reports inside AX UI should be just fine. But I cannot guarantee this. I'm not an AX expert, I only know some of the EP from an infrastructure point of view.