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)

how to consume wcf service in custom workflow?

(0) ShareShare
ReportReport
Posted on by 1,401

Hi 

I have  wcf service in local ( localhost  ) and how to consume in custom workflow in MS CRM onpremise.

Many thanks :)

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    ScottDurow Profile Picture
    21 on at

    Hi,

    You can make a custom workflow activity to call your service using WCF.

    See https://msdn.microsoft.com/en-gb/library/gg334455.aspx?f=255&MSPPError=-2147217396

    If you are on prem - make sure that you don't register your workflow plugin in Sanbox isolution mode since this will restrict access to services such as localhost and prevent you from using WCF bindings other than Basic HTTP.

    Hope this helps

  • Suggested answer
    nghieppham Profile Picture
    4,755 on at

    Hi Mclare,

    To do that, you just follow these steps:

    Step 1: Build and Publish the WCF Service

    Step 2: Deploy the WCF Service

    Step 3: Create WCF client

    But plugin or custom activity does not support to access third party dll in ISolation mode.

    And you should manual binding your service like below code:

    GenerateServiceClient()

    {

    Service1Client client = null;BasicHttpBinding myBinding = new BasicHttpBinding();myBinding.Name = "BasicHttpBinding_IService1";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("Your endpoint address");

    client = new Service1Client(myBinding, endPointAddress);

    return client;

    }

  • Suggested answer
    nghieppham Profile Picture
    4,755 on at

    Hi Mclare,

    To do that, you just follow these steps:

    Step 1: Build and Publish the WCF Service

    Step 2: Deploy the WCF Service

    Step 3: Create WCF client

    Step 4: Call your WCF form plugin/custom activity

    But plugin or custom activity does not support to access third party dll in ISolation mode.

    And you should manual binding your service like below code:

    GenerateServiceClient()

    {

    Service1Client client = null;BasicHttpBinding myBinding = new BasicHttpBinding();myBinding.Name = "BasicHttpBinding_IService1";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("Your endpoint address");

    client = new Service1Client(myBinding, endPointAddress);

    return client;

    }

  • Mclare Profile Picture
    1,401 on at

    Hi Scott , Thanks alot .  the link you have provided is not working . Can you provide correct url

  • ScottDurow Profile Picture
    21 on at

    Sorry about that - I've updated the link.

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