locked
Calling Webservice in CRM 4.0 RRS feed

  • Question

  • Hi All,
            
             Is it possible to call a webservice from a workflow.


    Thanks
    Midnight Programmer
    Thursday, June 11, 2009 2:57 PM

Answers

  • Prashant,

     I apologize for posting a response without fully understanding what you are trying to accomplish.  From your last response, I assume you are trying to call a web service, not necessarily the CRM web service, from the workflow form.

    This is not possible without a custom workflow activity to serve as a wrapper around the web service call.
    Thursday, June 11, 2009 3:39 PM

All replies

  • Yes, the following code is from the SDK help file:

    protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
            {
                IContextService contextService = (IContextService)executionContext.GetService(typeof(IContextService));
                IWorkflowContext context = contextService.Context;
    
                CrmService crmService = (CrmService)context.CreateCrmService();
    
                return base.Execute(executionContext);
            }
    Thursday, June 11, 2009 3:23 PM
  • Thanks Richard..

    But is it possible to call it from the workflow that we create in crm for an entity?
    Midnight Programmer
    Thursday, June 11, 2009 3:30 PM
  • Prashant,

     I apologize for posting a response without fully understanding what you are trying to accomplish.  From your last response, I assume you are trying to call a web service, not necessarily the CRM web service, from the workflow form.

    This is not possible without a custom workflow activity to serve as a wrapper around the web service call.
    Thursday, June 11, 2009 3:39 PM
  • Thanks for the help Richard.

    Regards
    Midnight Programmer
    Thursday, June 11, 2009 3:53 PM