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)

Web service Could not find default endpoint element that references contract

(0) ShareShare
ReportReport
Posted on by

Hi,

I wan to call method in Webservice which i have reference in my plugins project file and used proxy class to call it. But when I try to test it.

WebserviceCould not find default endpoint element that references contract 'ServiceRef1.IService' 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. at System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors(ServiceEndpoint serviceEndpoint, String configurationName)
at System.ServiceModel.ChannelFactory.ApplyConfiguration(String configurationName, Configuration configuration)
at System.ServiceModel.ChannelFactory.InitializeEndpoint(String 

Please help...

*This post is locked for comments

I have the same question (0)
  • ashlega Profile Picture
    34,477 on at

    Hi,

     basically, you have to configure everything in code:

    docs.microsoft.com/.../configuring-wcf-services-in-code

     You can't use configuration files with plugins

  • Community Member Profile Picture
    on at

    I need to call webservice based on specific field change. So on trigger of plugin, I need to call webservice

  • ashlega Profile Picture
    34,477 on at

    You can call a web service, you just cannot use a configuration file.. so, whatever settings you have there, you'll need to configure them in the plugin code instead.

    Here is a better example:

    stackoverflow.com/.../how-to-create-a-wcf-client-without-settings-in-config-file

  • David Jennaway Profile Picture
    14,065 on at

    It sounds like you've created a service reference, and Visual Studio puts configuration data into the app.config file. However, the app.config is owned by the process, and plugins run within one of the CRM processes, rather than it's own process, so the configuration data will be missing. There are 2 main approaches you could take:

    • If it's On-Premise, then you could modify the .config file for the respective CRM process (this could be the w3wp process, or sandbox, or async service, depending how the plugin runs)
    • Programmatically build the config information, rather than read it from the .config file. This is definitely possible, but there's a lot of detail to work through
  • Community Member Profile Picture
    on at

    I tried following with the link provided. But I got another issue with

    There was no endpoint listening at inte.ind.com/Service.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

    Server stack trace:

    at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()

    at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)

    at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)

    at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)

    at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)

    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)

    at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)

    at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

  • Community Member Profile Picture
    on at

    Can you help how programmatically build the config info and call the service.

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