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 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

    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

    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

    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

    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…

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