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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

OrganizationServiceProxy vs CrmServiceClient ?

(0) ShareShare
ReportReport
Posted on by 56

Hello,

can anyone explain what is the difference between this two "services" when opening connection to CRM from web application?

Why should i use one over other one?

And this thing is confusing, why do you create an instance of CrmServiceClient with OrganizationServiceProxy ?

CrmServiceClient(OrganizationServiceProxy);

or even better after you create an instance of CrmServiceClient, why do you cast it to IOrganizationService 

 

CrmServiceClient conn = new Xrm.Tooling.Connector.CrmServiceClient(connectionString);
private IOrganizationService _orgService;
_orgService = (IOrganizationService)conn.OrganizationWebProxyClient != null ? (IOrganizationService)conn.OrganizationWebProxyClient : (IOrganizationService)conn.OrganizationServiceProxy;

Thank you :)

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Guido Preite Profile Picture
    54,086 Moderator on at

    you can just use CrmServiceClient and you don't need to cast to IOrganizationService

    CrmServiceClient service = new Xrm.Tooling.Connector.CrmServiceClient(connectionString);

    and after use service with the same methods as IOrganizationService, so you can do service.Create, service.Update, service.RetrieveMultiple

  • Stuie Profile Picture
    255 on at

    Hi Guido

    I've tried this but I'm seeing a error. Any advise please?

    Dim service As CrmServiceClient = New CrmServiceClient(ConfigurationManager.ConnectionStrings("CRM").ConnectionString)


    Error at create method;

    Object reference not set to an instance of an object.

  • DBTL Profile Picture
    on at

    Very late response but I think its good to put something here rather than leave an open question.
    In this case, put ConfigurationManager.ConnectionStrings("CRM").ConnectionString in to a variable then check it has a value.

    This is just a logical error and not related to CRM. 
    Chances are that CRM section wasn't found in the config so you passed a null to the next level.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans