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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to communicate external web servis in custom Workflow?

(0) ShareShare
ReportReport
Posted on by

Hi everyone, i'm currently work on a custom workflow. In this custom workflow, i must connect external web service, send it a data and take new data back. I'm little bit confused. How can i call external web service in my workflow here is the my code;

 GetCustomerInfoService.TransactionServiceClient client = null;

                try
                {
                    client = new GetCustomerInfoService.TransactionServiceClient();

                    GetCustomerInfoService.TransactionRequest request = new GetCustomerInfoService.TransactionRequest();
                 
                    #region authentication
                    GetCustomerInfoService.AuthenticationData auth = new GetCustomerInfoService.AuthenticationData();
                    auth.UserName = "username";
                    auth.Password = "password";
                    request.AuthenticationData = auth;
                    #endregion

                    Guid id = Guid.NewGuid(); //create random guid
                    request.RequestId = id.ToString();
                    request.OrderNumber = "W162299784";


                    GetCustomerInfoService.TransactionResponse response = client.GetTransactionByOrderNumber(request);
                    tmpContact = ContactHandler.GetContactViaCustomerCode(organizationServiceContext, response.Transaction.CustomerId.ToString());

                    if (tmpContact != null) // Null Check
                    {
                        tmpIncident.CustomerId = new EntityReference("Contact", tmpContact.ContactId.Value);
                    }

                    this.updateChanges(organizationServiceContext, tmpIncident);


*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: How to communicate external web servis in custom Workflow?

    When i run the workflow i get this message;

    "Could not find default endpoint element that references contract 'GetCustomerInfoService.ITransactionService' 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."

  • Verified answer
    abhishek_255 Profile Picture
    1,614 on at
    RE: How to communicate external web servis in custom Workflow?

    Hello,

    If it is CRM online and sandbox mode, then you have to write code for binding within custom activity, there should't be any config file.

    mscrmmindfire.wordpress.com/.../calling-external-web-service-from-a-crm-2011-plug-in

    Also there are some limitation in sandbox mode web access.

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

    If my response helps you, please mark it as "Verified"

    Best Regards,

    Abhishek

  • Community Member Profile Picture
    on at
    RE: How to communicate external web servis in custom Workflow?

    now i get following message;

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

  • Community Member Profile Picture
    on at
    RE: How to communicate external web servis in custom Workflow?

    Well, finally i can finnish my code. Your links eas very usefull. Thanks.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

#3
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans