locked
Custom C# Workflow stuck on 'Waiting' during REST request in CRM Online RRS feed

  • Question

  • I've created a custom workflow that uses REST calls to communicate with a LOB system. When checking the code through a test unit, it posts fine. However, when I push this onto CRM as a workflow, the workflow status becomes stuck on 'Waiting'. Through logging, I've found this happens whenever the REST request is built.

    I have tried two different approaches. The first, is using the HttpWebRequest class. Whenever GetRequestStream() is called, the workflow hangs. Which seems odd, as it's a pretty standard function. I'm certain the code is correct, as it runs fine when run standalone. Even when hooking up to the debugger, the code steps through perfectly fine.

    The second is using the HttpClient class. Again, the workflow hangs, this time when calling the PostAsync() method, which I can only assume is calling whatever GetRequestStream() is calling.

    The error in the log is a generic one, "Something went wrong, contact your Administrator" etc. However, the exception type seems to be System.Security.SecurityException.

    I would like to avoid using a custom web service just to make REST calls. Is there any more troubleshooting I can do, or perhaps even a solution to this issue?

    Thanks.

    Thursday, January 14, 2016 9:09 AM

Answers

  • Looks like my suspicions were correct. The workflow runs off a different IP, so enabling the whole /24 block through our firewall seems to have let it through. Weird how it didn't throw any exceptions or anything. All working now!

    • Marked as answer by risualdev Thursday, January 14, 2016 10:12 AM
    Thursday, January 14, 2016 10:12 AM

All replies

  • this can be related to the sandbox limitations for CRM Online, it this url public available? it's an IP address or has a name? (ip addresses are not allowed) there is some kind of authentication involved when you call this service?

    My blog: www.crmanswers.net - CRM Theme Generator

    Thursday, January 14, 2016 9:27 AM
  • Hi Guido,

    The URL isn't publically available, but should be accessible as I've let the IP of the CRM Online instance in. The service has a host name, and the authentication type is Basic, which I've populated the header with the right details.

    Is it possible the IP the workflow is sending requests under is different to the IP of the CRM Online instance?

    Thursday, January 14, 2016 9:36 AM
  • Looks like my suspicions were correct. The workflow runs off a different IP, so enabling the whole /24 block through our firewall seems to have let it through. Weird how it didn't throw any exceptions or anything. All working now!

    • Marked as answer by risualdev Thursday, January 14, 2016 10:12 AM
    Thursday, January 14, 2016 10:12 AM