Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Cannot fix System.ArgumentException : Value does not fall within the expected range exception

Posted on by Microsoft Employee

I am using Web services for GP 2010 and I get following error in events log.

-------------------------------------------

Exception type:
Microsoft.Dynamics.Security.InvalidSecurityContextException

Exception message:
System.ArgumentException : Value does not fall within the expected range.

SecurityContext:
ApplicationKey: 25cc1a21-2cc4-4b13-a1c8-eea186fb688a
ScopeKey: 13
User: Domain\User

Action:
GetRoles

Input parameters:
<RequestObjects>
<string>Domain\User</string></RequestObjects>

Stack Trace:
at Microsoft.Dynamics.Security.ValidationHelper.ValidateContext(SecurityContext context)
at Microsoft.Dynamics.Security.AzManMemberAccess.GetRoles(SecurityContext context, String member)

-------------------------------------------

I have tried to repair GP Web services using the wizard, removed and added back but no success. I kind of know that security is the issue but don't know where to fix it.  eConnect service and GP Service Host service are running under Domain\User account. In the SQL Server Domain\User has permissions on Dynamics DB and Company DB.

Thanks,

Sai

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Cannot fix System.ArgumentException : Value does not fall within the expected range exception

    Hi Sai,

    I'm having the same problem with the same exception; I don't suppose you remember some of the things you had done to deal with this error?\

    Thanks!

    Jeremy

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Cannot fix System.ArgumentException : Value does not fall within the expected range exception

    I have fixed this problem. I have done few things so don't know what fixed it. It looks like SQL timeout caused the issue. I had to revert my VMs, reconfigure web service, give access to user etc. to fix it.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Cannot fix System.ArgumentException : Value does not fall within the expected range exception

    Basically, proxy.GetPolicyByOperation("CreateSalesInvoice", context) is failing, not the actual CreateSalesInvoice() method. To double check, I removed all other code and executed only GetPolicyByOperation(). The authorization store is SQL Server DB.

    There are two events in the event log of server. One difference I have noted here is Application and Scope key are null in the warning but they are present in Information.

    --------Warning----------

    Exception type:
    System.ArgumentException

    Exception message:
    Value does not fall within the expected range.

    SecurityContext:
    ApplicationKey: null
    ScopeKey: null
    User: Domain\User

    Action:
    Get

    Input parameters:
    <RequestObjects>
    <ApplicationKey xmlns:xsi="www.w3.org/.../XMLSchema-instance" xmlns:xsd="www.w3.org/.../XMLSchema">
    <Id xmlns="schemas.microsoft.com/.../01">25cc1a21-2cc4-4b13-a1c8-eea186fb688a</Id>
    </ApplicationKey></RequestObjects>

    Stack Trace:
    at Microsoft.Interop.Security.AzRoles.AzAuthorizationStoreClass.Initialize(Int32 lFlags, String bstrPolicyURL, Object varReserved)
    at Microsoft.Dynamics.Security.AzManHelper.Initialize()
    at Microsoft.Dynamics.Security.AzManHelper..ctor()
    at Microsoft.Dynamics.Security.AzManHelper.GetInstance()
    at Microsoft.Dynamics.Security.AzManApplicationServiceImplementation.RetrieveForGetByKey(SecurityContext context, Key key)
    at Microsoft.Dynamics.Security.SecurityService.Get(SecurityContext context, Key key)

    ---------------------------

    ------Information-----------

    Exception type:
    Microsoft.Dynamics.Security.InvalidSecurityContextException

    Exception message:
    System.ArgumentException : Value does not fall within the expected range.

    SecurityContext:
    ApplicationKey: 25cc1a21-2cc4-4b13-a1c8-eea186fb688a
    ScopeKey: 13
    User: Domain\User

    Action:
    GetRoles

    Input parameters:
    <RequestObjects>
    <string>Domain\User</string></RequestObjects>

    Stack Trace:
    at Microsoft.Dynamics.Security.ValidationHelper.ValidateContext(SecurityContext context)
    at Microsoft.Dynamics.Security.AzManMemberAccess.GetRoles(SecurityContext context, String member)

    ------------------------------

    Thanks,

    Sai

  • Suggested answer
    soma Profile Picture
    soma 24,406 on at
    RE: Cannot fix System.ArgumentException : Value does not fall within the expected range exception

    Its seems like there are two elements added with same name on your source code. There is nothing problem within web service. Please verify the code and try again.

    Hope this helps!!!

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans