Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Class ‘getItemCode’ method UAX Access to the ‘AppWebService19101A001’ has been refused.

(0) ShareShare
ReportReport
Posted on by 75

The questions are as follows:

I have two accounts, builduser and api101, with the same ad administrator and role.

When I restart ax service: builduser can call API normally, but api101 reports the following error:


[Class ‘getItemCode’ method UAX Access to the ‘AppWebService19101A001’ has been refused.]

When a user starts the project: api101 can also call the API normally


Project situation

1. Publish AX ServiceGroup

2. C# project reference refers to WSDL

3. Publish the C# project to IIS.

4. When the C# project calls the AX method, the following information is passed for authentication

// 会社
context.Company = HttpContext.Current.Request.Headers[DataConst2.COMPANY];
// ドメイン
serviceClient.ClientCredentials.Windows.ClientCredential.Domain = HttpContext.Current.Request.Headers[DataConst2.DOMAIN];

// ユーザー名
serviceClient.ClientCredentials.Windows.ClientCredential.UserName = HttpContext.Current.Request.Headers[DataConst.USER];
// パスワード
serviceClient.ClientCredentials.Windows.ClientCredential.Password = HttpContext.Current.Request.Headers[DataConst.PASSWORD];

5.AX Class

6.AX Service

7.AX ServiceGroup

  • xiaoshuai.fan Profile Picture
    75 on at
    RE: Ax service connection failed

    The questions are as follows:

    I have two accounts, builduser and api101, with the same ad administrator and role.

    When I restart ax service: builduser can call API normally, but api101 reports the following error:

        Class ‘getItemCode’ method UAX Access to the ‘AppWebService19101A001’ has been refused.

    When a user starts the project: api101 can also call the API normally

    Project situation

    1. Publish AX ServiceGroup

    2. C# project reference refers to WSDL

    3. Publish the C# project to IIS.

    4. When the C# project calls the AX method, the following information is passed for authentication

    context.Company = HttpContext.Current.Request.Headers[DataConst.COMPANY];

                   // Domain

                   serviceClient.ClientCredentials.Windows.ClientCredential.Domain = HttpContext.Current.Request.Headers[DataConst.DOMAIN];

                   // UserName

                   serviceClient.ClientCredentials.Windows.ClientCredential.UserName = HttpContext.Current.Request.Headers[DataConst.USER];

                   // Password

                   serviceClient.ClientCredentials.Windows.ClientCredential.Password = HttpContext.Current.Request.Headers[DataConst.PASSWORD];

                   // AX method

                   itemNum = serviceClient.getItemCode(context, brand, item, vendCategory, maker, itemSequence);

  • xiaoshuai.fan Profile Picture
    75 on at
    RE: Ax service connection failed

    Thanks for your answer

    My problem has changed now and the situation is as follows.

    Project situation

    1. Publish AX ServiceGroup

    2. C# project reference refers to WSDL

    3. Publish the C# project to IIS.

    4. When the C# project calls the AX method, the following information is passed for authentication

                   context.Company = HttpContext.Current.Request.Headers[DataConst.COMPANY];

                   // Domain

                   serviceClient.ClientCredentials.Windows.ClientCredential.Domain = HttpContext.Current.Request.Headers[DataConst.DOMAIN];

                   // UserName

                   serviceClient.ClientCredentials.Windows.ClientCredential.UserName = HttpContext.Current.Request.Headers[DataConst.USER];

                   // Password

                   serviceClient.ClientCredentials.Windows.ClientCredential.Password = HttpContext.Current.Request.Headers[DataConst.PASSWORD];

                   // AX method

                   itemNum = serviceClient.getItemCode(context, brand, item, vendCategory, maker, itemSequence);

    Question:

    When I test locally, I am able to get the return value successfully

    But when an external user makes a call, it fails to connect to the AX service.

    In order to prevent the authentication information from being passed incorrectly,

    I set the username and password to a fixed value

  • xiaoshuai.fan Profile Picture
    75 on at
    RE: Ax service connection failed

    The following event log is added when BuildUser

    ?Special Logon?

    5700.MicrosoftTeams_2D00_image-_2800_2_2900_.png

    In addition,

    I now know that BuildUser is in the administrator group ,API101 is not among them

    Does this have anything to do with it

  • Martin Dráb Profile Picture
    233,396 Most Valuable Professional on at
    RE: Ax service connection failed

    Please give us more details. What exactly do you mean by "the screen starts". What exception or HTTP code are you getting when you're "unable to connect"? Which protocol (TCP/HTTP) are you using?

  • Community Member Profile Picture
    on at
    RE: Ax service connection failed

    do you see any event logs when the connection fails?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 254

#2
Martin Dráb Profile Picture

Martin Dráb 230 Most Valuable Professional

#3
Adis Profile Picture

Adis 169 Super User 2025 Season 1

Overall leaderboard

Product updates

Dynamics 365 release plans