web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

OrganizationService error "Expected non-empty string. Parameter name: authenticationInfo"

(0) ShareShare
ReportReport
Posted on by

Hi, all.

I am using custom WCF Service which invokes OrganizationService.Create method.

When I am using it from visual studio debug - it works well and successfully returns me guid of created record.
But when I am trying to call the same service hosted at IIS - it returns a strange error.

<s:Envelope xmlns:s="schemas.xmlsoap.org/.../envelope">
<s:Body>
<s:Fault>
<faultcode xmlns:a="schemas.microsoft.com/.../dispatcher">a:InternalServiceFault</faultcode>
<faultstring xml:lang="ru-RU">Expected non-empty string.</faultstring>
<detail>
<ExceptionDetail xmlns="schemas.datacontract.org/.../System.ServiceModel" xmlns:i="www.w3.org/.../XMLSchema-instance">
<HelpLink i:nil="true"/>
<InnerException>
<HelpLink i:nil="true"/>
<InnerException i:nil="true"/>
<Message>Expected non-empty string.
Parameter name: authenticationInfo</Message>
<StackTrace i:nil="true"/>
<Type>System.ArgumentException</Type>
</InnerException>
<Message>Expected non-empty string.</Message>
<StackTrace>at Microsoft.Crm.Exceptions.ThrowIfEmpty(String value, String parameterName)
at Microsoft.Crm.Authentication.UserManagementFactory.ValidateSpecialUser(String authenticationInfo, Guid organizationId)
at Microsoft.Crm.Authentication.UserIdentityAuthorizationManager.ValidateSpecialUser(String authenticationInfo, Guid organizationId)
at Microsoft.Crm.Authentication.ClaimsIdentityAuthorizationManager.CheckAccess(AuthorizationContext context)
at Microsoft.Crm.Authentication.WindowsIdentityAuthorizationManager.Authenticate(OperationContext operationContext)
at Microsoft.Crm.Authentication.WindowsIdentityAuthorizationManager.CheckAccessCore(OperationContext operationContext)
at System.ServiceModel.Dispatcher.AuthorizationBehavior.Authorize(MessageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc&amp; rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace>
<Type>Microsoft.Crm.CrmArgumentException</Type>
</ExceptionDetail>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>

I checked it and found - this exception comes from OrganizationService.
What can be the reason of such behaviour? Any ideas?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    KZee Profile Picture
    on at

    It works in visual studio probably because it might be using your credentials to connect to CRM organization service.

    Your wcf service will be using the app pool identity it is running under to connect to CRM.

    Try setting the app pool identity to your account and see if it works.

    Thanks

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    Please provide code where you instantiate crm service instance.

  • Community Member Profile Picture
    on at

    private OrganizationServiceProxy serviceProxy;
    private Uri osUri = new Uri("dyncrm2012/.../Organization.svc");

    private ClientCredentials cc = new ClientCredentials();
    cc.UserName.UserName = contact.Login;
    cc.UserName.Password = contact.Password;

    serviceProxy = new OrganizationServiceProxy(osUri, null, cc, null);

    ...

    sResponse.Id = serviceProxy.Create(NewContact);

    At the moment of exception - correct CRM user's login and password are in client credentials of serviceProxy object. I checked it in debug mode.

  • Community Member Profile Picture
    on at

    Hi, thank you for your help.

    I created new app pool with domain user as identity - and in this pool my service works.

    But it is still unclear for me, why it doesnt work in CrmAppPool with network service identity account?

    Shouldnt it work by default?

  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Seems that you use Domain Authentication and that means that you incorrectly pass credentials

    Instead of

    private ClientCredentials cc = new ClientCredentials();
    cc.UserName.UserName = contact.Login;
    cc.UserName.Password = contact.Password;

    you should use

    private ClientCredentials cc = new ClientCredentials();
    credentials.Windows.ClientCredential = new NetworkCredential(contact.Login, contact.Password, "<Put domain here>");


  • Community Member Profile Picture
    on at

    Thank you very much, Andrii.

    Now it works even from CRMAppPool.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans