Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

How to change WS-Trust security in a project

Posted on by 645

My situation is that suddenly I get :Value cannot be null.Parameter name: service  when trying to get organizationservice,after googling I found that my proj uses WS-Trust security and it might create my problems,

after reading about it in ms docs I found that this might be my case :

If you are accessing the CrmServiceClient.OrganizationServiceProxy property:

Remove all use of that property in your code. CrmServiceClient implements IOrganizationService and exposes everything that is settable for the organization service proxy.

My question is if I remove my use of :

 CrmServiceClient crmServiceClient = new CrmServiceClient( connectionString);
IOrganizationService organizationService = (IOrganizationService)crmServiceClient.OrganizationWebProxyClient != null
? (IOrganizationService)crmServiceClient.OrganizationWebProxyClient : (IOrganizationService)crmServiceClient.OrganizationServiceProxy;

what could be the replacement ? 


Does anyone deal with that case? Is there an other way to solve it ?

  • Suggested answer
    RE: How to change WS-Trust security in a project

    Hello Sahara,

    Based on the documentation below the OrganizationServiceProxy has been deprecated:

    https://docs.microsoft.com/en-us/power-platform/important-changes-coming#deprecation-of-office365-authentication-type-and-organizationserviceproxy-class-for-connecting-to-common-data-service

    The reason why we deprecated it is because it was using WS-Trust.

    In the document, you have more details about it.

    Given the security concern the OrganizationServiceProxy and the way it has been initially implemented, I will kindly ask you to review the code and instead of using OrganizationServiceProxy, you can try to use CrmServiceClient.

    More details about it are available in the article below:

    https://docs.microsoft.com/en-us/dotnet/api/microsoft.xrm.tooling.connector.crmserviceclient?view=dynamics-xrmtooling-ce-9

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans