Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Unable to consume a WCF Service from a Plugin

Posted on by 370

Hi Experts,

I am in a trouble since yesterday, I have a Plugin from which i am trying to call a Service Method of a WCF service. But i am facing this error:

Could not find default endpoint element that references contract 'ServiceReference1.IAccount' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.'

This is how my app.config of Client (Plugin) looks like,

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IAccount" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://someipadress:xy/CRMService.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IAccount"
contract="IAccount" name="BasicHttpBinding_IAccount" />
</client>

</system.serviceModel>

</configuration>

*This post is locked for comments

  • Verified answer
    Prem27 Profile Picture
    Prem27 370 on at
    RE: Unable to consume a WCF Service from a Plugin

    Thanks Ravi,

    This approach works, i read this  on a similar thread code.msdn.microsoft.com/How-to-call-External-WCF-42c4490d,

    however in this thread instead of using client, channel is used.

    Thanks a lot!!

  • Verified answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Unable to consume a WCF Service from a Plugin

    Hi Prem,

    The configuration is not accessible within a plugin. You need to add this configuration programmatically

    Check this blog which has the complete explanation on why and how to-

    nishantrana.me/.../calling-wcf-service-in-plugin-in-crm

    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