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)

Call wcf service from plugin or workflow in dynamics crm

(0) ShareShare
ReportReport
Posted on by

I have a wcf service hosted on hostgator and i want to call that from workflow or plugin registered in plugin registration tool.And i am working with dynamics crm online.

Is this possible?if yes then give me the solution or reference link else please suggest me any alternative solution

*This post is locked for comments

I have the same question (0)
  • nghieppham Profile Picture
    4,755 on at

    Hi Chhaya,

    Yes, you can consuming web service from custom workflow activity or plugin.

    There are 2 ways to do that in CRM Online.

    1. You can host your web service in Azure server and then consume it via BasicHttpBinding.

    2. If you host your service at your server, you have to consume it via IP of your server (also using BasicHttpBinding)

    Regards,

  • Community Member Profile Picture
    on at

    Hi Pham Hong Nghiep,

    For 2nd way can you give any reference link that how to consume via IP and BasicHttpBinding

  • Verified answer
    nghieppham Profile Picture
    4,755 on at

    Hi Chhaya,

    You can download this sample from Microsoft at this link code.msdn.microsoft.com/How-to-call-External-WCF-42c4490d

    Just correct to use your IP.

    Regards,

  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at

    Also you should be to connect custom web services only if they are deployed on standard secured port 80 or 443. You can consume it in a standard way like in .net applications.

    Thanks

  • Community Member Profile Picture
    on at

    Hi,

    When I am trying  code.msdn.microsoft.com/How-to-call-External-WCF-42c4490d i get below error.

    Additional information: Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.


    Below is my code.

    BasicHttpBinding myBinding = new BasicHttpBinding();
    myBinding.Name = "BasicHttpBinding_PAWebIService";
    myBinding.Security.Mode = BasicHttpSecurityMode.None;
    myBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;
    myBinding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None;
    myBinding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName;
    EndpointAddress endPointAddress = new EndpointAddress("192.168.1.126/PAWebService.svc");
    ChannelFactory<PAPlugin.ServiceReference1.PAWebIServiceClient> factory = new ChannelFactory<PAPlugin.ServiceReference1.PAWebIServiceClient>(myBinding, endPointAddress);
    PAPlugin.ServiceReference1.PurchaseAssistantLicenseWebIService channel = factory.CreateChannel();
    var ans = channel.IsValidByDomainName(domainname, "2");


    Please suggest what is the error of?


  • Suggested answer
    abhishek_255 Profile Picture
    1,614 on at

    Hi,

    Plugin registered in CRM online runs into isolation mode "sandbox". Sandbox isolation mode has some limitations in web access to external resources.

    Please check WEB ACCESS section in below link-

    msdn.microsoft.com/.../gg334752.aspx

    In CRM Online, you cannot access wcf service methods directly through IP address, you would need to assign a web address(URL) to the service and that web address will be used as pointer for your web service in plugin.

    Best Regards,

    Abhishek

  • Community Member Profile Picture
    on at

    Hi Abhishek, When I am debug with plugin then at the stage of calling function of service with DNS name instead of IP then each time  "Plugin Registration Tool has stop Working" is displayed and pluginregistration tool closed.what to do?

    Stopped at below line:

    var ans = channel.IsValidByDomainName(domainname, "2");




  • Community Member Profile Picture
    on at

    Hi Chhaya,

    Did you find the solution, even I am facing the same issue.

  • Community Member Profile Picture
    on at

    You can check here how we can call WCF service in plugin or workflow-

    http://msdynamiccrmcustomizations.blogspot.com/2018/07/call-external-wcf-service-from-custom.html

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