Philippsen's Blog

Everyday findings in my world of .net and related stuff

Archive for January, 2011

Microsoft Dynamics Business Connector facts

Posted by Torben M. Philippsen on January 3, 2011

In a recent integration project I was working on, we encountered some performance issues regarding the use of the Microsoft Dynamics .net Business connector for Microsoft Dynamics AX 2009. The problem was related to an AIF created WCF service hosted in an IIS environment. The WCF service was supposed to handle many simultanously request but analyzis showed that even when eg. 100 simultanous requests was made at the same time, only a maximum of two business connectors showed up in the “online users” in AX.

To understand what was going on, a support case at Microsoft was created and below, I will summaraixe some of the information Microsft provided:

If you too are wondering why only two connections shows up in the “online users” in AX please refer to Microsofts support blog at http://blogs.msdn.com/b/emeadaxsupport/archive/2009/05/14/the-thing-about-the-net-business-connector-and-the-number-of-online-users.aspx

You should also be aware of the license information provided by Microsoft:

License consumption for Business Connector in AX 2009

Using Business Connector from a non web based external application.

When BC (.NET Business Connector) is used in Dynamics Ax 2009, 2 sessions are created. One of them is called “Worker”, and this is the main BC session (process start). Every time there is Login call from BC a new session is created which is called “Business Connector”.
When the LogOff is called the “Business Connector” session is removed. When the BC process itself terminates then the “Worker” session is removed.
If you start a process and then login multiple times in parallel without logging off you will see 1 “Worker” session and multiple “Business Connector” sessions.
E.g. if same user logs on e.g. two times within the same process then you will have three sessions in Online Users form, 1 “Worker” and 2 “Business Connector”.

For .NET Business Connector, there is no “Business Connector Users” license enforcement done at the product level.
The customer is responsible for licensing the number of BC.net’s that they use (even though we do not enforce the license). The license agreement is a legal contract.
So from a licensing point of view:
You need “Business Connector Users” license, one for each concurrent logon by a distinct user.
Using Business Connector from a web based application (e.g. Enterprise Portal).

For EP or any Web used apps which uses LogonAs, there will be one session called “Business Connector” which will be the main session (one BC worker process connection for every worker process). This will be a persistent connection as long as the process is started & live and at least one EP page is served.
EP pages are stateless, so the web user connection is not persistent. For every page request the web user connection will be established (and a “Web user” session will be shown in “Online users” and in SysClientSessions the field Status = 1), page will be rendered and after a small time (for performance reasons), the connection will be teared off (in SysClientSessions the field Status = 0).

For EP, there is no “Enterprise Portal Users” license enforcement done at the product level.
The customer is responsible for licensing the number of BC.net’s and Web users that they use (even though we do not enforce the license). The license agreement is a legal contract.
So from a licensing point of view:
1. You need “Business Connector Users” license, one for each web server and
2. “Enterprise Portal users” (Web user) license – either concurrent user license or named user license.
Do Microsoft enforce the licenses and if so how?

With enforced license it means that you will not be able to log in if you exceed the number of logged in users.

The answer is that all licenses are enforced except for “Enterprise Portal Users” and “Business Connector Users”.
This means that if you don’t have license for a module/feature then you will not be able to use the module/feature and for normal users (Win clients) you will not be able to log inn more than the number of concurrent users that you have license for.
E.g. If you have license for 2 COM clients and you have 3 web servers and you try to log in the business connector(BC) from the third web server then the BC will not be able to log in.

For Web users there is no enforcement which means that you will be able to have more users logged in to EP than you have web user license for.

Thanks goes to Microsofts support team that helped solving this issue.

Advertisements

Posted in Business Connector, Microsoft Dynamics AX | 5 Comments »

Find out which control triggered post back event

Posted by Torben M. Philippsen on January 3, 2011

In a recent Reporting Services web project I used the ReportViewer control to display reports.

In order to position some asp.net controls properly according to whether the parameters bar was present or not, I needed to determine if the “view report” button was clicked – causing the postback. Analyzing the html output of the reportviewer control, I needed to deterrmine if the control with id “ReportViewer1_ctl00_ctl00” caused the postback.

This is what I did:

    Control ctrl = GetPostBackControl(this);

    if (ctrl.ClientID.Equals(“ReportViewer1_ctl00_ctl00”))

    {

        ImageButton1.CssClass = “”;

        LinkButton1.CssClass = “LinkButton”;

    }

 

And the code for the GetPostBackControl method:

    public static Control GetPostBackControl(Page page)

    {

        Control control = null;

        string ctrlname = page.Request.Params.Get(“__EVENTTARGET”);

        if (ctrlname != null && ctrlname != string.Empty)

        {

            control = page.FindControl(ctrlname);

        }

        else

        {

            foreach (string ctl in page.Request.Form)

            {

                if ((ctl.LastIndexOf(“.x”) > 0) || (ctl.LastIndexOf(“.y”) > 0))

                {

                    control = page.FindControl(ctl.Substring(0, ctl.Length – 2));

                    break;

                }

                control = page.FindControl(ctl);

                if ((control is System.Web.UI.WebControls.Button))

                {

                    break;

                }

            }

        }

        return control;

    }

Posted in asp.net, Reporting Services | Tagged: , | 1 Comment »

Windows autentication problem on Dynamics AX WCF service

Posted by Torben M. Philippsen on January 3, 2011

Over the past days I have been involved in a critical issue related to a Dynamics AX 2009 WCF service that used windows authentication on a Windows server 2008 box (IIS 7.0).

When trying to browse the service I was prompted for login credentials, but even though proper credentials were provided, I was not correctly authenticated (and neither was any of the clients that was supposed to consume the service) and a new login prompth just showed up. Looking in the eventviewer, in the security section, I was able to identify that a login attempt using my user account has been made and that it actually succeeded.
The funny thing – that wasn’t funny at all, was that how could it be that the eventviewer stated, that the login attempt was successfull when IIS still kept prompting me for credentials???
It somehow seemed that login credentials wasn’t properly passed on to the WCF service…

Analyzing the server setup further showed that a distributed environment had been configured. This pointed me in the direction of some Kerberos settings that hadn’t been properly configured.

The solution turned out to be quite simpel – the only thing I had to do was to disable “enable kernel-mode authentication” – this is what i did:

  • In the IIS manager right click the website or application where Windows Autentication has been configured
  • In the “features view” double click “autentication”. You will see a list of autentication profiles and their corresponding status.
  • Right click “windows autentication” and select “advanced settings”
  • Disable “enable Kernel-mode authentication”

    disable Kernel-mode

    disable Kernel-mode autentication

Be carefull… As the information box states, this should only be done when using a non custom identity. In my case, the problem related to a Dynamics AX WCF service. Such a service is always configured to use a domain account identity and therefore the “Kernel-mode” could be disabled.

For some reason unknown to me, the Kerberos ticket was not properly distributed to all involved servers – and due to that I was unable to logon to the WCF service. Disabling “Kernel-mode authentication” solved that problem and clients are now able to consume the service.

Update 24.01.2012

Today this woraround didn’t work – apparently I was facing a new problem and I had to have a colleague assist me. Fortunately he knows some tricks:-)

With reference to this article http://support.microsoft.com/kb/926642 (method 1) solved the problem – even though that my issue was on a server 2008 box – here’s a screendump:

For further references on troubleshooting and/or configuring kerberos, please check out this post:

http://blogs.msdn.com/b/distributedworld/archive/2012/04/24/troubleshoot-kerberos-in-wcf.aspx
http://www.microsoft.com/en-us/download/details.aspx?id=16080

Posted in IIS | Tagged: , , , , , | Comments Off on Windows autentication problem on Dynamics AX WCF service

 
%d bloggers like this: